Fix PR handling in pipeline #30
Workflow file for this run
This file contains hidden or 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
name: Run tests on Testing Farm | |
on: | |
push: | |
branches: [ master ] | |
pull_request_target: | |
types: [opened, synchronize, reopened] | |
jobs: | |
test-init: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
statuses: write | |
steps: | |
- name: Get User Permission | |
id: checkAccess | |
uses: actions-cool/check-user-permission@v2 | |
with: | |
require: write | |
username: ${{ github.triggering_actor }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check User Permission | |
if: steps.checkAccess.outputs.require-result == 'false' | |
run: | | |
echo "${{ github.triggering_actor }} does not have permissions on this repo." | |
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}" | |
echo "Job originally triggered by ${{ github.actor }}" | |
exit 1 | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Test init on Fedora VM | |
uses: sclorg/testing-farm-as-github-action@main | |
with: | |
api_key: ${{ secrets.TESTING_FARM_API_TOKEN }} | |
compose: Fedora-Rawhide | |
tmt_path: "tmt" | |
tmt_plan_regex: "fedora-init" | |
pull_request_status_name: "Fedora init test" | |
create_github_summary: "true" | |
update_pull_request_status: "true" | |
variables: "REPO_URL=${{ github.server_url }}/${{ github.repository }};PR_HEAD=${{ github.event.pull_request.head.sha }};" | |
test-upgrade: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
statuses: write | |
steps: | |
- name: Get User Permission | |
id: checkAccess | |
uses: actions-cool/check-user-permission@v2 | |
with: | |
require: write | |
username: ${{ github.triggering_actor }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check User Permission | |
if: steps.checkAccess.outputs.require-result == 'false' | |
run: | | |
echo "${{ github.triggering_actor }} does not have permissions on this repo." | |
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}" | |
echo "Job originally triggered by ${{ github.actor }}" | |
exit 1 | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Test upgrade on Fedora VM | |
uses: sclorg/testing-farm-as-github-action@main | |
with: | |
api_key: ${{ secrets.TESTING_FARM_API_TOKEN }} | |
compose: Fedora-Rawhide | |
tmt_path: "tmt" | |
tmt_plan_regex: "fedora-upgrade" | |
pull_request_status_name: "Fedora upgrade test" | |
update_pull_request_status: "true" | |
create_github_summary: "true" | |
variables: "REPO_URL=${{ github.server_url }}/${{ github.repository }};PR_HEAD=${{ github.event.pull_request.head.sha }};" |