Skip to content

Commit 6782e70

Browse files
authored
Update check-releases.yml
1 parent 7d8dd24 commit 6782e70

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

.github/workflows/check-releases.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,34 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717

18-
- name: Switch to gh-pages branch
19-
run: git checkout gh-pages
20-
21-
- name: Copy check-releases.js and README.md from main branch
22-
run: git checkout main -- check-releases.js README.md
23-
2418
- name: Set up Node.js
2519
uses: actions/setup-node@v3
2620
with:
2721
node-version: '18'
2822

2923
- name: Install dependencies
30-
run: npm install axios
24+
run: npm ci
3125

3226
- name: Check and update latest releases
3327
env:
3428
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3529
run: node check-releases.js
3630

37-
- name: Commit changes to gh-pages
31+
- name: Commit and push changes
3832
run: |
3933
git config --local user.name "GitHub Actions Bot"
4034
git config --local user.email "[email protected]"
35+
36+
# Create and switch to a temporary branch
37+
git checkout -b update-releases
4138
42-
git add badges.json
43-
git commit -m "Update badges.json with latest release URLs" || echo "No changes to commit for badges.json"
44-
git push origin gh-pages
45-
46-
- name: Switch to main branch
47-
run: git checkout main
48-
49-
- name: Commit README.md changes
50-
run: |
51-
git add README.md
52-
git commit -m "Update README.md with updated GitHub download links" || echo "No changes to commit for README.md"
53-
git push origin main
39+
# Stage and commit changes
40+
git add badges.json README.md
41+
git commit -m "Update badges.json and README.md with latest release URLs" || echo "No changes to commit"
5442
43+
# Push changes and create a pull request
44+
git push origin update-releases
45+
5546
- name: Create pull request
5647
uses: peter-evans/create-pull-request@v5
5748
with:

0 commit comments

Comments
 (0)