-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update deleted assets workflow (#5591)
* Update deleted assets workflow * Refactor redirects label workflow to use add_label_for_deleted_files.js * Update mergify.yml to remove adding the deleted-assets label * Update job name and some fixes
- Loading branch information
Showing
5 changed files
with
80 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Add deleted-assets label | ||
on: | ||
workflow_run: | ||
workflows: ['Deleted Assets Workflow'] | ||
types: [completed] | ||
env: | ||
ARTIFACT_NAME: deletedAssetsArtifact | ||
LABEL_TO_ADD: deleted-assets | ||
jobs: | ||
addRedirectsNeededLabel: | ||
name: Add deleted-assets label | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' | ||
permissions: | ||
pull-requests: write # used to add label | ||
steps: | ||
- name: Checkout repository to get the workflow scripts | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 https://github.com/actions/checkout/commit/c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | ||
- name: Download artifact | ||
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410 | ||
env: | ||
WORKSPACE: ${{ github.workspace }} | ||
with: | ||
script: | | ||
const { getArtifact } = require('./.github/workflows/scripts/utilities.js'); | ||
const fs = require('fs'); | ||
const artifactName = process.env.ARTIFACT_NAME; | ||
const workspace = process.env.WORKSPACE | ||
getArtifact({github, context, fs, artifactName, workspace}); | ||
- name: Unzip artifact | ||
run: unzip '${{ env.ARTIFACT_NAME }}.zip' | ||
- name: Add redirects-needed label to PR | ||
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const { addLabelForDeletedFiles } = require('./.github/workflows/scripts/add_label_for_deleted_files.js'); | ||
const fs = require('fs'); | ||
const artifactName = process.env.ARTIFACT_NAME; | ||
const label = process.env.LABEL_TO_ADD; | ||
addLabelForDeletedFiles({github, context, fs, core, artifactName, label}); |
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
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