-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mimicking the set-up we have at https://github.com/UCL-MIRSG/.github/tree/main/actions. Required for @r-roker-ucl to add issues/PRs to project boards.
- Loading branch information
1 parent
79d60db
commit 58addb3
Showing
15 changed files
with
358 additions
and
53 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
name: Links | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- renovate/** | ||
pull_request: | ||
|
||
jobs: | ||
links: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 2 | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
|
||
- uses: ./actions/links | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Linting | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- renovate/** | ||
pull_request: | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
|
||
- uses: ./actions/linting | ||
with: | ||
pre-commit-config: ./.pre-commit-config.yaml |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
name: Bump Version Tag | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "**/*" | ||
- "!**/*.json" | ||
- "!**/*.json5" | ||
- "!**/*.md" | ||
- "!.github/**" | ||
- "!.gitignore" | ||
- "!.pre-commit-config.yaml" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tags: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Bump version and push tag | ||
id: bump-version | ||
# yamllint disable-line rule:line-length | ||
uses: anothrNick/github-tag-action@afe4b67b57b8ab0908e4767109a5342003639e2e # v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: true | ||
|
||
- name: Extract major tag | ||
id: extract-major | ||
run: >- | ||
echo major_tag=$(echo ${{ steps.bump-version.outputs.new_tag }} | cut | ||
-d'.' -f1) >> $GITHUB_OUTPUT | ||
# this is done manually as need a non-annotated tag | ||
# TODO: replace with https://github.com/actions/publish-action | ||
- name: Update major tag | ||
run: |- | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git tag --force ${{ steps.extract-major.outputs.major_tag }} \ | ||
${{ steps.bump-version.outputs.new_tag }} | ||
git push origin ${{ steps.extract-major.outputs.major_tag }} --force |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Composite Actions | ||
|
||
A set of | ||
[composite actions](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action) | ||
that can be called by other workflows in the ARC organisation. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# add-to-project | ||
|
||
This action can be used in the following manner to add issues to project boards: | ||
|
||
```yaml | ||
jobs: | ||
add-issue-to-project: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: UCL-ARC/.github/actions/add-to-project@vx | ||
with: | ||
app-id: ${{ secrets.APP_ID }} | ||
app-pem: ${{ secrets.APP_PEM }} | ||
project-url: project_board_url | ||
``` | ||
where `x` is the `major` version of the action, and `project_board_url` is the | ||
full URL of the project board to which the repository's issues should be added. | ||
If a particular label should trigger the action to go to a different project | ||
board then one may specify the `label` input as follows: | ||
|
||
```yaml | ||
jobs: | ||
add-issue-to-project: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: UCL-ARC/.github/actions/add-to-project@vx | ||
with: | ||
app-id: ${{ secrets.APP_ID }} | ||
app-pem: ${{ secrets.APP_PEM }} | ||
label: label_name | ||
project-url: project_board_url | ||
``` | ||
|
||
where `label_name` is a | ||
[comma-separated list of labels](https://github.com/actions/add-to-project/tree/main?tab=readme-ov-file#inputs). | ||
Lastly, `label-operator` may be used to specify the logical operator to be used | ||
when checking for the presence of labels. The default value is `OR`, but may be | ||
configured as follows: | ||
|
||
```yaml | ||
jobs: | ||
add-issue-to-project: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: UCL-ARC/.github/actions/add-to-project@vx | ||
with: | ||
app-id: ${{ secrets.APP_ID }} | ||
app-pem: ${{ secrets.APP_PEM }} | ||
label: label_name | ||
label-operator: AND | ||
project-url: project_board_url | ||
``` | ||
|
||
where `label-operator` may be set to `AND`, `NOT` or `OR`. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Add Issues to Project | ||
description: Add issues to the GitHub project board | ||
|
||
inputs: | ||
app-id: | ||
description: Application ID | ||
required: true | ||
|
||
app-pem: | ||
description: Application private key | ||
required: true | ||
|
||
labeled: | ||
description: Label to filter issues by | ||
default: "" | ||
|
||
label-operator: | ||
description: Operator to filter issues by label | ||
default: OR | ||
|
||
project-url: | ||
description: URL of the project board to add issues to | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Generate token | ||
id: generate-token | ||
# yamllint disable-line rule:line-length | ||
uses: actions/create-github-app-token@ad38cffc07bac6e3857755914c4c88bfd2db4da4 # v1 | ||
with: | ||
app-id: ${{ inputs.app-id }} | ||
private-key: ${{ inputs.app-pem }} | ||
|
||
- name: Get project data | ||
# yamllint disable-line rule:line-length | ||
uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2 | ||
with: | ||
github-token: ${{ steps.generate-token.outputs.token }} | ||
label-operator: ${{ inputs.label-operator }} | ||
labeled: ${{ inputs.labeled }} | ||
project-url: ${{ inputs.project-url }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# links | ||
|
||
This action can be used in the following manner: | ||
|
||
```yaml | ||
jobs: | ||
links: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 2 | ||
steps: | ||
- uses: UCL-ARC/.github/actions/links@vx | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
where `x` is the `major` version of the action. If custom link checking is | ||
required, one can add custom inputs through `lychee-args`, i.e.: | ||
|
||
```yaml | ||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: UCL-ARC/.github/actions/linting@vx | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
lychee-args: | ||
--base . --verbose --no-progress './**/*.md' './**/*.html' | ||
'./**/*.rst' | ||
``` |
Oops, something went wrong.