-
Notifications
You must be signed in to change notification settings - Fork 328
Expand file tree
/
Copy pathsync-training-material-metadata.yml
More file actions
94 lines (84 loc) · 3.43 KB
/
Copy pathsync-training-material-metadata.yml
File metadata and controls
94 lines (84 loc) · 3.43 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Sync Training Material Files
on:
workflow_dispatch:
schedule:
# Run daily at 2 AM UTC
- cron: "0 2 * * *"
jobs:
sync-files:
name: Sync files from training-material
runs-on: ubuntu-latest
if: github.repository_owner == 'galaxyproject'
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout current repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.HUB_BOT_APP_CLIENT_ID }}
private-key: ${{ secrets.HUB_BOT_APP_PRIVATE_KEY }}
- name: Checkout training-material repository
uses: actions/checkout@v7
with:
repository: galaxyproject/training-material
path: training-material
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 1
sparse-checkout: |
CONTRIBUTORS.yaml
ORGANISATIONS.yaml
GRANTS.yaml
bin/schema-contributors.yaml
bin/schema-grants.yaml
bin/schema-organisations.yaml
sparse-checkout-cone-mode: false
- name: Copy files from training-material
run: |
cp training-material/CONTRIBUTORS.yaml content/CONTRIBUTORS.yaml
cp training-material/ORGANISATIONS.yaml content/ORGANISATIONS.yaml
cp training-material/GRANTS.yaml content/GRANTS.yaml
cp training-material/bin/schema-contributors.yaml content/schema-contributors.yaml
cp training-material/bin/schema-grants.yaml content/schema-grants.yaml
cp training-material/bin/schema-organisations.yaml content/schema-organisations.yaml
- name: Check for changes
id: check-changes
run: |
if git diff --quiet content/CONTRIBUTORS.yaml content/ORGANISATIONS.yaml content/GRANTS.yaml content/schema-contributors.yaml content/schema-grants.yaml content/schema-organisations.yaml; then
echo "changed=false" >> $GITHUB_OUTPUT
echo "No changes detected in the files."
else
echo "changed=true" >> $GITHUB_OUTPUT
echo "Changes detected in the files."
fi
- name: Create Pull Request
if: steps.check-changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: |
Sync files from galaxyproject/training-material
- Update CONTRIBUTORS.yaml
- Update ORGANISATIONS.yaml
- Update GRANTS.yaml
- Update schema-contributors.yaml
- Update schema-grants.yaml
- Update schema-organisations.yaml
title: 'Sync: Update files from training-material'
body: |
This PR automatically syncs the following files from [galaxyproject/training-material](https://github.com/galaxyproject/training-material):
- `CONTRIBUTORS.yaml`
- `ORGANISATIONS.yaml`
- `GRANTS.yaml`
- `schema-contributors.yaml`
- `schema-grants.yaml`
- `schema-organisations.yaml`
Please review the changes and merge if everything looks correct.
branch: sync/training-material
delete-branch: true
labels: automated, sync