Skip to content

Commit

Permalink
fips-label.yml: Fix the script after actions/github-script upgrade
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #19636)

(cherry picked from commit ada6f05)
  • Loading branch information
t8m authored and paulidale committed Nov 9, 2022
1 parent 0804311 commit 3ede8f1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/fips-label.yml
Expand Up @@ -28,15 +28,15 @@ jobs:
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "fips_checksum"
})[0];
var download = await github.actions.downloadArtifact({
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
Expand All @@ -55,22 +55,22 @@ jobs:
var fs = require('fs');
var pr_num = Number(fs.readFileSync('./pr_num'));
if ( fs.existsSync('./fips_changed') ) {
github.issues.addLabels({
github.rest.issues.addLabels({
issue_number: pr_num,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['severity: fips change']
});
} else if ( fs.existsSync('./fips_unchanged') ) {
var labels = await github.issues.listLabelsOnIssue({
var labels = await github.rest.issues.listLabelsOnIssue({
issue_number: pr_num,
owner: context.repo.owner,
repo: context.repo.repo
});
for ( var label in labels.data ) {
if (labels.data[label].name == 'severity: fips change') {
github.issues.removeLabel({
github.rest.issues.removeLabel({
issue_number: pr_num,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down

0 comments on commit 3ede8f1

Please sign in to comment.