simple-icons/.github/workflows/create-release.yml
Eric Cornelissen e0df400494
Setup prettier (#6758)
* Add prettier as a dependency

* Add format command and configure prettier

I opted for single quotes to be in line with other simple-icons projects

I ignore the data file because changing its formatting is quite a bit of
trouble for all open PRs.

* Run prettier

* Replace all functions by arrow functions

* Move prettier configuration to config file

Move it to a file so editors (and other software) can pick up on the
configuration. I went with .js because (a) it allows for comments and
(2) it seems most of the config files are in JavaScript already.

* Add prettier --check when running npm run lint (This adds it to the CI as well)

* Add husky and format changes before committing

* Use object destructuring for imports consistently

* Add shebang and fileoverview to jsonlint.js
2021-10-25 21:13:10 +02:00

57 lines
2.2 KiB
YAML

name: Create Release Pull Request
on:
# THIS WORKFLOW SHOULD NEVER BE TRIGGERED ON A PUSH EVENT. IF TRIGGERED ON A
# PUSH EVENT IT MAY CREATE AN ENDLESS STREAM OF 'version bump' COMMITS.
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
if: github.event_name != 'push'
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: |
github.event_name != 'push' &&
needs.release-pr.outputs.did-create-pr == 'true'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Ensure the commit can be pushed regardless of branch protections (must belong to an admin of this repo)
token: ${{ secrets.RELEASE_TOKEN }}
# 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.12.0
with:
commit_message: version bump
commit_user_name: 'github-actions[bot]'
commit_user_email: 'github-actions[bot]@users.noreply.github.com'
commit_author: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'