From 2ba10608d7b61f82eda183854e9ee921c257e27f Mon Sep 17 00:00:00 2001 From: Andrei Rybak Date: Sat, 28 Oct 2023 16:47:18 +0200 Subject: [PATCH] .github: check-metadata: new workflow Add a GitHub Actions workflow to run the maintenance script "check-metadata.sh" on pushes to branch 'main' and on pull requests which target branch 'main'. I'm not sure if `concurrency:` is needed. I used the following GitHub Actions files as inspiration: - For overall structure: - https://github.com/curl/curl/blob/c39585d9b7ef3cbfc1380812dec60e7b275b6af3/.github/workflows/linkcheck.yml - For job naming and Bash script launch: - https://github.com/rybak/intellij-copy-commit-reference/blob/47a64c7408d854f73fa59a053d9346c27122bafe/.github/workflows/build.yml --- .github/workflows/check-metadata.yml | 33 ++++++++++++++++++++++++++++ maintenance/check-metadata.sh | 6 +++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/check-metadata.yml diff --git a/.github/workflows/check-metadata.yml b/.github/workflows/check-metadata.yml new file mode 100644 index 0000000..7748797 --- /dev/null +++ b/.github/workflows/check-metadata.yml @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: MIT + +name: Check metadata + +on: + push: + branches: + - main + pull_requests: + branches: + - main + paths: + - '*.user.js' + - '*.user.css' + - 'maintenance/check-metadata.sh' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: {} + +jobs: + check: + name: Check metadata + runs-on: ubuntu-latest + steps: + - name: Fetch source code + uses: actions/checkout@v4 + + - name: Do check metadata + run: + ./maintenance/check-metadata.sh diff --git a/maintenance/check-metadata.sh b/maintenance/check-metadata.sh index 48720e9..7396366 100755 --- a/maintenance/check-metadata.sh +++ b/maintenance/check-metadata.sh @@ -1,5 +1,11 @@ #!/bin/bash +# Check metadata of userscripts and userstyles +# +# Used by GitHub Actions. Can be used locally: +# +# $ ./maintenance/check-metadata.sh + set -e set -u