commit 45f223f42e29daa52003721f314fe7b642a9b8b8 parent cb0d41f5813156086199899f1f3d7b684acfe7ec Author: MTRNord <mtrnord1@gmail.com> Date: Tue, 10 Oct 2023 19:15:48 +0200 Make the pullrequest flow a command instead to prevent secret leaking Diffstat:
| M | .github/workflows/pullrequest.yml | | | 16 | +++++++++++----- |
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml @@ -3,13 +3,14 @@ name: Validate on: push: branches: [main] - pull_request: + issue_comment: + types: [created] jobs: linting: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v3 - name: Run yamllint run: yamllint . validate: @@ -17,11 +18,16 @@ jobs: issues: write pull-requests: write needs: linting - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event.isue.pullrequest && contains(github.event.comment.body, '/test') }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - name: Get PR branch + uses: xt0rted/pull-request-comment-branch@v2 + id: comment-branch + - uses: actions/checkout@v3 + with: + ref: ${{ steps.comment-branch.outputs.head_ref }} + - uses: actions/setup-python@v4 with: python-version: '3.12' - run: pip install -r requirements.txt