Skip to content

Commit

Permalink
Update secure_assets.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
stargazer4 authored May 2, 2024
1 parent cf83cee commit 093058f
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions .github/workflows/secure_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ on:
types: [opened, edited]

jobs:
check-and-update:
check-assets:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Check for assets
id: assets
uses: actions/github-script@v5
with:
script: |
Expand All @@ -29,44 +28,10 @@ jobs:
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}`);
return {
dateCreated,
author,
issueOrPrLink,
commentLink,
repoName
};
}
- name: Upload assets.txt
uses: actions/upload-artifact@v2
with:
name: assets.txt
path: ./assets.txt

- name: Update inventory issue
uses: actions/github-script@v5
with:
script: |
const dateCreated = "${{ steps.assets.outputs.dateCreated }}";
const author = "${{ steps.assets.outputs.author }}";
const issueOrPrLink = "${{ steps.assets.outputs.issueOrPrLink }}";
const commentLink = "${{ steps.assets.outputs.commentLink }}";
const repoName = "${{ steps.assets.outputs.repoName }}";
const issueNumber = "25";
const newLine = `| ${dateCreated} | ${author} | ${issueOrPrLink} | ${commentLink} | ${repoName} |`;
const issue = await github.issues.get({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
issue_number: issueNumber
});
const issueBody = issue.data.body + '\n' + newLine;
github.issues.update({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
issue_number: issueNumber,
body: issueBody
});

0 comments on commit 093058f

Please sign in to comment.