Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Commit bb5d83a

Browse files
chore: update global workflows (#336)
1 parent 1d18ce8 commit bb5d83a

File tree

9 files changed

+139
-147
lines changed

9 files changed

+139
-147
lines changed

.github/pr_release_template.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/auto-create-pr.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/automerge.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/codeql.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ name: "CodeQL"
99

1010
on:
1111
push:
12-
branches: ["master", "nightly"]
12+
branches: ["master"]
1313
pull_request:
14-
branches: ["master", "nightly"]
14+
branches: ["master"]
1515
schedule:
1616
- cron: '00 12 * * 0' # every Sunday at 12:00 UTC
1717

@@ -140,9 +140,12 @@ jobs:
140140
submodules: recursive
141141

142142
- name: Setup msys2
143-
if: runner.os == 'Windows'
143+
if: >-
144+
runner.os == 'Windows' &&
145+
matrix.language == 'cpp'
144146
uses: msys2/setup-msys2@v2
145147
with:
148+
msystem: ucrt64
146149
update: true
147150

148151
# Initializes the CodeQL tools for scanning.
@@ -157,6 +160,10 @@ jobs:
157160
# yamllint disable-line rule:line-length
158161
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
159162
# queries: security-extended,security-and-quality
163+
config: |
164+
paths-ignore:
165+
- node_modules
166+
- third-party
160167
161168
# Pre autobuild
162169
# create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository
@@ -180,3 +187,26 @@ jobs:
180187
uses: github/codeql-action/analyze@v3
181188
with:
182189
category: "/language:${{matrix.language}}"
190+
output: sarif-results
191+
upload: failure-only
192+
193+
- name: filter-sarif
194+
uses: advanced-security/filter-sarif@v1
195+
with:
196+
input: sarif-results/${{ matrix.language }}.sarif
197+
output: sarif-results/${{ matrix.language }}.sarif
198+
patterns: |
199+
-node_modules/**
200+
-third\-party/**
201+
202+
- name: Upload SARIF
203+
uses: github/codeql-action/upload-sarif@v3
204+
with:
205+
sarif_file: sarif-results/${{ matrix.language }}.sarif
206+
207+
- name: Upload loc as a Build Artifact
208+
uses: actions/upload-artifact@v4
209+
with:
210+
name: sarif-results-${{ matrix.language }}-${{ runner.os }}
211+
path: sarif-results
212+
retention-days: 1

.github/workflows/python-flake8.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ name: flake8
99

1010
on:
1111
pull_request:
12-
branches: [master, nightly]
12+
branches: [master]
1313
types: [opened, synchronize, reopened]
1414

1515
concurrency:
16-
group: ${{ github.workflow }}-${{ github.ref }}
16+
group: "${{ github.workflow }}-${{ github.ref }}"
1717
cancel-in-progress: true
1818

1919
jobs:

.github/workflows/release-notifier.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ name: Release Notifications
99

1010
on:
1111
release:
12-
types: [published]
13-
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onevent_nametypes
12+
types:
13+
- released # this triggers when a release is published, but does not include prereleases or drafts
1414

1515
jobs:
1616
discord:
1717
if: >-
1818
startsWith(github.repository, 'LizardByte/') &&
19-
not(github.event.release.prerelease) &&
20-
not(github.event.release.draft)
19+
!github.event.release.prerelease &&
20+
!github.event.release.draft
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: discord
@@ -35,8 +35,8 @@ jobs:
3535
facebook_group:
3636
if: >-
3737
startsWith(github.repository, 'LizardByte/') &&
38-
not(github.event.release.prerelease) &&
39-
not(github.event.release.draft)
38+
!github.event.release.prerelease &&
39+
!github.event.release.draft
4040
runs-on: ubuntu-latest
4141
steps:
4242
- name: facebook-post-action
@@ -52,8 +52,8 @@ jobs:
5252
facebook_page:
5353
if: >-
5454
startsWith(github.repository, 'LizardByte/') &&
55-
not(github.event.release.prerelease) &&
56-
not(github.event.release.draft)
55+
!github.event.release.prerelease &&
56+
!github.event.release.draft
5757
runs-on: ubuntu-latest
5858
steps:
5959
- name: facebook-post-action
@@ -69,8 +69,8 @@ jobs:
6969
reddit:
7070
if: >-
7171
startsWith(github.repository, 'LizardByte/') &&
72-
not(github.event.release.prerelease) &&
73-
not(github.event.release.draft)
72+
!github.event.release.prerelease &&
73+
!github.event.release.draft
7474
runs-on: ubuntu-latest
7575
steps:
7676
- name: reddit
@@ -89,8 +89,8 @@ jobs:
8989
twitter:
9090
if: >-
9191
startsWith(github.repository, 'LizardByte/') &&
92-
not(github.event.release.prerelease) &&
93-
not(github.event.release.draft)
92+
!github.event.release.prerelease &&
93+
!github.event.release.draft
9494
runs-on: ubuntu-latest
9595
steps:
9696
- name: twitter

.github/workflows/update-changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Update Changelog
27-
uses: LizardByte/update-changelog-action@v2024.520.183314
27+
uses: LizardByte/update-changelog-action@v2024.609.4705
2828
with:
2929
changelogBranch: changelog
3030
changelogFile: CHANGELOG.md

.github/workflows/update-docs.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
# This action is centrally managed in https://github.com/<organization>/.github/
3+
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4+
# the above-mentioned repo.
5+
6+
# Use the `rtd` repository label to identify repositories that should trigger have this workflow.
7+
# If the project slug is not the repository name, add a repository variable named `READTHEDOCS_SLUG` with the value of
8+
# the ReadTheDocs project slug.
9+
10+
# Update readthedocs on release events.
11+
12+
name: Update docs
13+
14+
on:
15+
release:
16+
types: [created, edited, deleted]
17+
18+
concurrency:
19+
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
update-docs:
24+
env:
25+
RTD_SLUG: ${{ vars.READTHEDOCS_SLUG }}
26+
RTD_TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
27+
TAG: ${{ github.event.release.tag_name }}
28+
if: >-
29+
!github.event.release.draft
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Get RTD_SLUG
33+
run: |
34+
# if the RTD_SLUG is not set, use the repository name in lowercase
35+
if [ -z "${RTD_SLUG}" ]; then
36+
RTD_SLUG=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]')
37+
fi
38+
echo "RTD_SLUG=${RTD_SLUG}" >> $GITHUB_ENV
39+
40+
- name: Deactivate deleted release
41+
if: >-
42+
github.event_name == 'release' &&
43+
github.event.action == 'deleted'
44+
run: |
45+
json_body=$(jq -n \
46+
--arg active "false" \
47+
--arg hidden "false" \
48+
--arg privacy_level "public" \
49+
'{active: $active, hidden: $hidden, privacy_level: $privacy_level}')
50+
51+
curl \
52+
-X PATCH \
53+
-H "Authorization: Token ${RTD_TOKEN}" \
54+
https://readthedocs.org/api/v3/projects/${RTD_SLUG}/versions/${TAG}/ \
55+
-H "Content-Type: application/json" \
56+
-d "$json_body"
57+
58+
- name: Check if edited release is latest GitHub release
59+
id: check
60+
if: >-
61+
github.event_name == 'release' &&
62+
github.event.action == 'edited'
63+
uses: actions/github-script@v7
64+
with:
65+
script: |
66+
const latestRelease = await github.rest.repos.getLatestRelease({
67+
owner: context.repo.owner,
68+
repo: context.repo.repo
69+
});
70+
71+
core.setOutput('isLatestRelease', latestRelease.data.tag_name === context.payload.release.tag_name);
72+
73+
- name: Update RTD project
74+
# changing the default branch in readthedocs makes "latest" point to that branch/tag
75+
# we can also update other properties like description, etc.
76+
if: >-
77+
steps.check.outputs.isLatestRelease == 'true'
78+
run: |
79+
json_body=$(jq -n \
80+
--arg default_branch "${TAG}" \
81+
--arg description "${{ github.event.repository.description }}" \
82+
'{default_branch: $default_branch}')
83+
84+
curl \
85+
-X PATCH \
86+
-H "Authorization: Token ${RTD_TOKEN}" \
87+
https://readthedocs.org/api/v3/projects/${RTD_SLUG}/ \
88+
-H "Content-Type: application/json" \
89+
-d "$json_body"

.github/workflows/yaml-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ name: yaml lint
99

1010
on:
1111
pull_request:
12-
branches: [master, nightly]
12+
branches: [master]
1313
types: [opened, synchronize, reopened]
1414

1515
concurrency:
16-
group: ${{ github.workflow }}-${{ github.ref }}
16+
group: "${{ github.workflow }}-${{ github.ref }}"
1717
cancel-in-progress: true
1818

1919
jobs:

0 commit comments

Comments
 (0)