Skip to content

Commit

Permalink
Update permissions and add missing workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew W. Harn <[email protected]>
  • Loading branch information
awharn committed Sep 6, 2024
1 parent 5fae7b6 commit 7edfc5e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
test:
runs-on: ubuntu-latest
if: (!contains(github.event.head_commit.message, '[ci skip]'))

permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -192,6 +193,8 @@ jobs:
needs: test
runs-on: ubuntu-latest
if: needs.test.result == 'success' && github.event_name == 'pull_request_target'
permissions:
pull-requests: write
steps:
- name: Checkout Pages Branch
uses: actions/checkout@v4
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Remove Closed PR Contents

on:
pull_request_target:
types: closed

jobs:
remove-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout Pages Branch
uses: actions/checkout@v4
with:
ref: 'gh-pages'

- name: Remove directory
env:
GITHUB_TOKEN: ${{ secrets.ZOWE_ROBOT_TOKEN }}
run: |
rm -rf docs/pr-${{ github.event.number }}
git config --global user.name ${{ secrets.ZOWE_ROBOT_USER }}
git config --global user.email ${{ secrets.ZOWE_ROBOT_EMAIL }}
git rm -r docs/pr-${{ github.event.number }}
git commit -sm "Remove Zowe Web Help for PR ${{ github.event.number }}"
git push origin HEAD
gh workflow run -r gh-pages deploy-pages.yml

0 comments on commit 7edfc5e

Please sign in to comment.