Update add-label.js #392
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
name: Pull Request Trigger | |
on: | |
pull_request: | |
types: [opened, edited] | |
branches: | |
- '*' | |
jobs: | |
Check-For-Linked-Issue: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.action == 'opened' || github.event.action == 'edited' }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Check for keyword and issue number | |
id: check-for-keyword | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const script = require('./github-actions/trigger-pr/check-linked-issue.js') | |
const results = script({g: github, c: context}) | |
return results | |
# Create the message to post | |
- name: Create Instruction | |
uses: actions/github-script@v7 | |
id: instruction | |
with: | |
script: | | |
const script = require('./github-actions/pr-instructions/create-instruction.js') | |
return script({g: github, c: context}).then((instruction) => { | |
return JSON.stringify({ instruction: instruction, issueNum: context.payload.number }) | |
}) | |
# Create an artifact with the message | |
- name: Create Artifacts | |
run: | | |
mkdir -p addingPrInstructions/artifact | |
echo ${{ steps.instruction.outputs.result }} > addingPrInstructions/artifact/artifact.txt | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: adding-pr-instructions-artifact | |
path: addingPrInstructions/artifact/ |