-
Notifications
You must be signed in to change notification settings - Fork 8
45 lines (42 loc) · 1.5 KB
/
auto-release.yml
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
name: Automated Releases
on:
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '42 0 * * *'
jobs:
auto-release:
name: Automated release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Ensure we are checked out on the master branch
ref: master
# Ensure custom credentials are used when pushing
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Update simple-icons
id: update
run: |
newVersion="$(node scripts/bump-simpleicons.js)"
echo ::set-output name=NEW_VERSION::$newVersion
- name: Commit updates
run: |
# Set up git credential
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# Create a commit for the simple-icons dependency update
git add .
git diff-index --quiet HEAD || git commit -m "Update simple-icons to ${{ steps.update.outputs.NEW_VERSION }}"
- name: Push updates
run: |
# Set up remote using a Personal Access Token
git remote remove origin
git remote add origin https://${{secrets.RELEASE_TOKEN}}@github.com/developStorm/simple-badges.git
# Push updates to origin
git push origin master