-
Notifications
You must be signed in to change notification settings - Fork 35.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from john0isaac/fix-security-issue
feat: use new package and workflow
- Loading branch information
Showing
1 changed file
with
12 additions
and
96 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 |
---|---|---|
|
@@ -11,8 +11,6 @@ on: | |
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
|
@@ -26,32 +24,12 @@ jobs: | |
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Check broken Paths | ||
id: check-broken-paths | ||
uses: john0isaac/[email protected].0 | ||
uses: john0isaac/[email protected].1 | ||
with: | ||
command: check-broken-paths | ||
command: check_broken_paths | ||
directory: ./ | ||
guide-url: 'https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Leave broken paths comment | ||
if: ${{ steps.check-broken-paths.outputs.is-valid == 1 }} | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: ` | ||
We have automatically detected the following broken relative paths in your lessons. | ||
Please check the file paths and associated broken paths inside them. | ||
Learn more from our [contributing guide](https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md). | ||
# Check Broken Paths | ||
${{ env.BROKEN_PATHS }} | ||
` | ||
}) | ||
- name: Update workflow run status | ||
if: ${{ steps.check-broken-paths.outputs.is-valid == 1 }} | ||
run: exit 1 | ||
check-paths-tracking: | ||
if: ${{ always() }} | ||
needs: check-broken-paths | ||
|
@@ -64,33 +42,12 @@ jobs: | |
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Run Check paths tracking | ||
id: check-paths-tracking | ||
uses: john0isaac/[email protected].0 | ||
uses: john0isaac/[email protected].1 | ||
with: | ||
command: check-paths-tracking | ||
command: check_paths_tracking | ||
directory: ./ | ||
guide-url: 'https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Leave paths tracking comment | ||
if: ${{ steps.check-paths-tracking.outputs.is-valid == 1 }} | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: ` | ||
We have automatically detected missing tracking id from the following relative paths in your lessons. | ||
Please check the file paths and associated paths inside them. | ||
Learn more from our [contributing guide](https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md). | ||
# Check Missing Tracking from Paths | ||
${{ env.PATHS_TRACKING }} | ||
` | ||
}) | ||
- name: Update workflow run status | ||
if: ${{ steps.check-paths-tracking.outputs.is-valid == 1 }} | ||
run: exit 1 | ||
|
||
check-urls-tracking: | ||
if: ${{ always() }} | ||
needs: check-paths-tracking | ||
|
@@ -103,33 +60,12 @@ jobs: | |
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Run Check URLs tracking | ||
id: check-urls-tracking | ||
uses: john0isaac/[email protected].0 | ||
uses: john0isaac/[email protected].1 | ||
with: | ||
command: check-urls-tracking | ||
command: check_urls_tracking | ||
directory: ./ | ||
guide-url: 'https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Leave URLs tracking comment | ||
if: ${{ steps.check-urls-tracking.outputs.is-valid == 1 }} | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: ` | ||
We have automatically detected missing tracking id from the following URLs in your lessons. | ||
Please check the file paths and associated URLs inside them. | ||
Learn more from our [contributing guide](https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md). | ||
# Check Missing Tracking from URLs | ||
${{ env.URLS_TRACKING }} | ||
` | ||
}) | ||
- name: Update workflow run status | ||
if: ${{ steps.check-urls-tracking.outputs.is-valid == 1 }} | ||
run: exit 1 | ||
|
||
check-urls-locale: | ||
if: ${{ always() }} | ||
needs: check-urls-tracking | ||
|
@@ -142,29 +78,9 @@ jobs: | |
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Run Check URLs Country Locale | ||
id: check-urls-locale | ||
uses: john0isaac/[email protected].0 | ||
uses: john0isaac/[email protected].1 | ||
with: | ||
command: check-urls-locale | ||
command: check_urls_locale | ||
directory: ./ | ||
guide-url: 'https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Leave URLs locale comment | ||
if: ${{ steps.check-urls-locale.outputs.is-valid == 1 }} | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: ` | ||
We have automatically detected added country locale to URLs in your lessons. | ||
Please check the file paths and associated URLs inside them. | ||
Learn more from our [contributing guide](https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md). | ||
# Check Country Locale in URLs | ||
${{ env.URLS_LOCALE }} | ||
` | ||
}) | ||
- name: Update workflow run status | ||
if: ${{ steps.check-urls-locale.outputs.is-valid == 1 }} | ||
run: exit 1 |