Bump qs and express #27
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: Check for assets | |
on: | |
issues: | |
types: [opened, edited] | |
issue_comment: | |
types: [created, edited] | |
pull_request: | |
types: [opened, edited] | |
jobs: | |
check-assets: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Check for assets | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
const issueOrPrBody = context.payload.issue?.body || context.payload.pull_request?.body || context.payload.comment?.body; | |
if (issueOrPrBody.includes('/assets')) { | |
const fs = require('fs'); | |
const dateCreated = new Date().toISOString(); | |
const author = context.payload.sender.login; | |
const issueOrPrLink = context.payload.issue?.html_url || context.payload.pull_request?.html_url; | |
const commentLink = context.payload.comment?.html_url; | |
const repoName = context.repo.repo; | |
fs.writeFileSync('assets.txt', `Date created: ${dateCreated}\nAuthor: ${author}\nIssue/PR link: ${issueOrPrLink}\nComment link: ${commentLink}\nRepo name: ${repoName}`); | |
} | |
- name: Upload assets.txt | |
uses: actions/upload-artifact@v2 | |
with: | |
name: assets.txt | |
path: ./assets.txt |