Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
47 lines (45 loc) · 1.55 KB
/
Copy pathaction.yml
File metadata and controls
47 lines (45 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Archive GitHub traffic
description: >-
Snapshot repository views, clones, referrers and paths into your own repo,
before GitHub's 14-day window discards them.
author: Hafid Idrissi
branding:
icon: archive
color: orange
inputs:
token:
description: >-
Token with push access to the repositories being archived. The traffic
API refuses read-only tokens. For repositories other than the one running
the workflow, use a PAT with the `repo` scope.
required: true
owner:
description: Archive every non-fork repository owned by this user or org.
required: false
repos:
description: Comma-separated `owner/name` list. Takes precedence over `owner`.
required: false
out:
description: Directory to write into.
required: false
default: traffic
include-forks:
description: Include forks when discovering via `owner`.
required: false
default: 'false'
runs:
using: composite
steps:
- name: Archive traffic
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}
run: |
# Run as a module, not as a script. Executing cli.py directly gives it
# no package context, so its relative imports fail.
export PYTHONPATH="${{ github.action_path }}/src"
python -m traffic_archive.cli \
--out "${{ inputs.out }}" \
${{ inputs.repos && format('--repos "{0}"', inputs.repos) || '' }} \
${{ inputs.owner && format('--owner "{0}"', inputs.owner) || '' }} \
${{ inputs.include-forks == 'true' && '--include-forks' || '' }}