armbian-build/.github/workflows/build-kernel-on-merge-request.yml
Naveen 4577254e20
chore: Set permissions for GitHub actions (#3880)
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-11 18:04:11 +02:00

62 lines
1.5 KiB
YAML

name: Build at pull request
on:
workflow_dispatch:
pull_request:
types: [review_requested, ready_for_review]
paths-ignore:
- .github/workflows
permissions:
contents: read
jobs:
Check:
permissions:
contents: none
name: Checking
if: ${{ success() && github.repository_owner == 'Armbian' }}
uses: armbian/scripts/.github/workflows/check-for-changes.yml@master
with:
reference: ${{ github.event.pull_request.head.sha }}
runner: small
Build:
permissions:
contents: none
needs: Check
if: ${{ success() && github.repository_owner == 'Armbian' }}
uses: armbian/scripts/.github/workflows/build-kernel.yml@master
with:
uploading: "false"
runner: "fast"
reference: ${{ github.event.pull_request.head.sha }}
secrets:
GPG_KEY1: ${{ secrets.GPG_KEY1 }}
GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }}
GPG_KEY2: ${{ secrets.GPG_KEY2 }}
GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }}
SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }}
KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }}
KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }}
jobsend:
permissions:
contents: none
name: Cleanup
needs: [Build]
runs-on: "small"
if: ${{ github.repository_owner == 'Armbian' }}
steps:
- uses: geekyeggo/delete-artifact@v1
with:
name: changes
- uses: geekyeggo/delete-artifact@v1
with:
name: hash