-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.42 KB
/
CopyFIDOKey.yml
File metadata and controls
49 lines (40 loc) · 1.42 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
name: Main - Update FidoKeys in gh-pages
on:
workflow_run:
workflows: ["Main - Merge"]
types:
- completed
branches:
- main
workflow_dispatch:
jobs:
copy-file:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: main
- name: Set up Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Copy file to gh-pages branch
run: |
# Fetch and checkout the gh-pages branch
git fetch origin gh-pages
git checkout gh-pages
# Copy the FidoKeys.json from the main branch to the gh-pages branch
git checkout main -- Assets/FidoKeys.json
# Move the file to the desired location
mv Assets/FidoKeys.json Explorer/FidoKeys.json
# Copy the index.html from the main branch to the gh-pages branch
git checkout main -- Explorer/index.html
# Commit and push the changes if there are any updates
if [ -n "$(git status --porcelain)" ]; then
git add Explorer/FidoKeys.json Explorer/index.html
git commit -m "Update FidoKeys.json and index.html from main branch"
git push origin gh-pages
else
echo "No changes to commit."
fi