Automated Releases #1290
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |