1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-12-26 01:13:41 +02:00
simple-icons/.github/workflows/create-release.yml
Eric Cornelissen 2d819e57d5 Add workflow_dispatch to Create Release Pull Request workflow
Add the `workflow_dispatch` trigger to the Create Release Pull Request
workflow. This will allow us to more easily trigger the release Pull
Request if either 1) the scheduled run failed for whatever reason or 2)
an extra release is needed as per the DISCLAIMER.md.

You can read more about `workflow_dispatch` in the GitHub docs at:
https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
2021-06-15 23:50:14 +02:00

50 lines
1.7 KiB
YAML

name: Create Release Pull Request
on:
workflow_dispatch:
schedule:
# "At 00:00 on Sunday" (https://crontab.guru/once-a-week)
- cron: "0 0 * * 0"
# This Workflow can be triggered manually through the GitHub UI or API. For the
# API use the following request:
# curl -X POST \
# -H "Authorization: Bearer <token>" \
# -d '{"ref":"develop"}' \
# https://api.github.com/repos/simple-icons/simple-icons/actions/workflows/create-release.yml/dispatches
# Replacing <token> by a personal access token with scope `public_repo`
jobs:
release-pr:
runs-on: ubuntu-latest
outputs:
did-create-pr: ${{ steps.release.outputs.did-create-pr }}
new-version: ${{ steps.release.outputs.new-version }}
steps:
- uses: simple-icons/release-action@master
id: release
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version-bump:
runs-on: ubuntu-latest
needs: release-pr
if: needs.release-pr.outputs.did-create-pr == 'true'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Ensure we are checked out on the develop branch
ref: develop
- name: Bump version
run: node ./scripts/release/bump-version.js "${{ needs.release-pr.outputs.new-version }}"
- name: Update major version in CDN URLs
run: node ./scripts/release/update-cdn-urls.js
- name: Update slugs table
run: node ./scripts/release/update-slugs-table.js
- name: Commit version bump
uses: stefanzweifel/git-auto-commit-action@v4.11.0
with:
commit_message: version bump
commit_user_name: GitHub Actions
commit_user_email: actions@github.com
commit_author: GitHub Actions <actions@github.com>