Skip to content

Commit f88a4c9

Browse files
authored
Merge branch 'main' into 001-data-masking
2 parents 4a995e1 + e4bc1cd commit f88a4c9

21 files changed

Lines changed: 726 additions & 360 deletions

.github/scripts/constants.js

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

.github/scripts/post_release.js

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const { LABEL_PENDING_RELEASE, LABEL_RELEASED } = require('./constants');
1+
const LABEL_PENDING_RELEASE = 'pending-release';
2+
const LABEL_RELEASED = 'completed';
23

34
/**
45
* Fetch issues using GitHub REST API
@@ -37,26 +38,17 @@ const fetchIssues = async ({
3738
};
3839

3940
/**
40-
* Notify new release and close staged GitHub issue
41+
* Update labels on closed issues that are pending release
42+
*
43+
* Swaps the 'pending-release' label to 'completed' on each closed issue.
44+
* GitHub natively links releases to issues, so no comment is needed.
4145
*
4246
* @param {object} gh_client - Pre-authenticated REST client (Octokit)
4347
* @param {string} owner - GitHub Organization
4448
* @param {string} repository - GitHub repository
45-
* @param {string} release_version - GitHub Release version
4649
* @see {@link https://octokit.github.io/rest.js/v18#usage|Octokit client}
4750
*/
48-
const notifyRelease = async ({
49-
gh_client,
50-
core,
51-
owner,
52-
repository,
53-
release_version,
54-
}) => {
55-
const release_url = `https://github.com/${owner}/${repository}/releases/tag/v${release_version.replace(
56-
/v/g,
57-
''
58-
)}`;
59-
51+
const updateLabels = async ({ gh_client, core, owner, repository }) => {
6052
const issues = await fetchIssues({
6153
gh_client: gh_client,
6254
org: owner,
@@ -65,22 +57,7 @@ const notifyRelease = async ({
6557
});
6658

6759
issues.forEach(async (issue) => {
68-
core.info(`Updating issue number ${issue.number}`);
69-
70-
const comment = `This is now released under [${release_version}](${release_url}) version!`;
71-
try {
72-
await gh_client.rest.issues.createComment({
73-
owner: owner,
74-
repo: repository,
75-
body: comment,
76-
issue_number: issue.number,
77-
});
78-
} catch (error) {
79-
core.setFailed(error);
80-
throw new Error(
81-
`Failed to update issue ${issue.number} about ${release_version} release`
82-
);
83-
}
60+
core.info(`Updating labels for issue number ${issue.number}`);
8461

8562
// Remove staged label; keep existing ones
8663
const labels = issue.labels
@@ -106,14 +83,12 @@ const notifyRelease = async ({
10683

10784
// context: https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts
10885
module.exports = async ({ github, context, core }) => {
109-
const { RELEASE_VERSION } = process.env;
110-
core.info(`Running post-release script for ${RELEASE_VERSION} version`);
86+
core.info('Running post-release label update');
11187

112-
await notifyRelease({
88+
await updateLabels({
11389
gh_client: github,
11490
core,
11591
owner: context.repo.owner,
11692
repository: context.repo.repo,
117-
release_version: RELEASE_VERSION,
11893
});
11994
};

.github/workflows/bootstrap_region.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
ref: ${{ github.sha }}
4949
- name: Setup Node.js
50-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
50+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
5151
with:
5252
node-version: 24
5353
- name: Setup dependencies

.github/workflows/make-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
with:
4949
ref: ${{ github.sha }}
5050
- name: Setup Node.js
51-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
51+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
5252
with:
5353
node-version: 24
5454
cache: "npm"

.github/workflows/make-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
ref: ${{ github.ref }}
3636
fetch-depth: 0 # fetch all history, commits and tags, so we can determine the next version
3737
- name: Setup Node.js
38-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
38+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
3939
with:
4040
node-version: ${{ env.NODE_VERSION }}
4141
cache: "npm"

.github/workflows/ossf_scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ jobs:
4444

4545
# Upload the results to GitHub's code scanning dashboard.
4646
- name: "Upload to code-scanning"
47-
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
47+
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
4848
with:
4949
sarif_file: results.sarif

.github/workflows/post-release.yml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ name: Post Release
22

33
on:
44
# Triggered manually
5-
workflow_dispatch:
6-
inputs:
7-
versionNumber:
8-
required: true
9-
type: string
10-
description: "If running this manually please insert a version number that corresponds to the latest published in the GitHub releases (i.e. v1.1.1)"
5+
workflow_dispatch: {}
116
# Or triggered as result of a release
127
release:
138
types: [released]
@@ -20,26 +15,13 @@ jobs:
2015
permissions:
2116
contents: read
2217
issues: write
23-
discussions: write
24-
pull-requests: write
2518
runs-on: ubuntu-latest
26-
env:
27-
RELEASE_VERSION: ${{ inputs.versionNumber }}
2819
steps:
2920
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30-
- name: Get release version
31-
run: |
32-
# The code below does the following:
33-
# 1. If the workflow was triggered manually, it will use the version number provided by the user
34-
# 2. If the workflow was triggered by a release, it will use the version number of the release
35-
if [ -z "$RELEASE_VERSION" ]; then
36-
export RELEASE_VERSION=$(git describe --tags --abbrev=0)
37-
fi
38-
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
39-
- name: Update issues related to release
21+
- name: Update labels on issues related to release
4022
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
4123
with:
4224
github-token: ${{ secrets.GITHUB_TOKEN }}
4325
script: |
4426
const post_release = require('.github/scripts/post_release.js')
45-
await post_release({github, context, core})
27+
await post_release({github, context, core})

.github/workflows/publish-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
with:
4040
ref: ${{ github.sha }}
4141
- name: Setup NodeJS
42-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
42+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4343
with:
4444
node-version: 24
4545
cache: "npm"

.github/workflows/publish_layer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
ref: ${{ github.sha }}
4343
- name: Setup Node.js
44-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
44+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4545
with:
4646
node-version: 24
4747
- name: Setup dependencies

.github/workflows/quality_check.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Checkout code
3939
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4040
- name: Setup NodeJS
41-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
41+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4242
with:
4343
node-version: ${{ matrix.version }}
4444
cache: "npm"
@@ -69,7 +69,7 @@ jobs:
6969
- name: Checkout code
7070
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7171
- name: Setup NodeJS
72-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
72+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7373
with:
7474
node-version: 24
7575
cache: "npm"
@@ -89,7 +89,7 @@ jobs:
8989
- name: Checkout code
9090
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9191
- name: Setup NodeJS
92-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
92+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
9393
with:
9494
node-version: 24
9595
cache: "npm"
@@ -109,7 +109,7 @@ jobs:
109109
- name: Checkout code
110110
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
111111
- name: Setup NodeJS
112-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
112+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
113113
with:
114114
node-version: 24
115115
cache: "npm"
@@ -127,7 +127,7 @@ jobs:
127127
- name: Checkout code
128128
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
129129
- name: Setup NodeJS
130-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
130+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
131131
with:
132132
node-version: 24
133133
cache: "npm"

0 commit comments

Comments
 (0)