Skip to content

Commit

Permalink
.github: check-metadata: new workflow
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rybak committed Oct 28, 2023
1 parent 286d70c commit 2ba1060
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/check-metadata.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions maintenance/check-metadata.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 2ba1060

Please sign in to comment.