chore: directly reference integration tests as job #2098
Workflow file for this run
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
name: pr_run_inttest | |
on: | |
pull_request_target: | |
permissions: | |
pull-requests: write | |
id-token: write | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get PR issue_number | |
run: | | |
PR_NUMBER="${{ github.event.pull_request.number || github.event.issue.number }}" | |
echo "PR number is: ${PR_NUMBER}" | |
echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_ENV | |
- name: Check for Secret availability | |
if: github.event.pull_request.head.repo.fork == true | |
shell: bash | |
run: | | |
echo "Integration tests can not run due to lacking permissions! You are \ | |
working in a forked repository." | |
- name: Generate token | |
if: github.event.pull_request.head.repo.fork == false | |
id: generate_token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.OCMBOT_APP_ID }} | |
private_key: ${{ secrets.OCMBOT_PRIV_KEY }} | |
- name: Repository Dispatch | |
if: github.event.pull_request.head.repo.fork == false | |
uses: myrotvorets/[email protected] | |
with: | |
token: ${{ steps.generate_token.outputs.token }} # metadata:read and contents:read&write | |
repo: open-component-model/ocm-integrationtest | |
type: ocm_pr | |
payload: '{ "ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "pr": "${{ env.PR_NUMBER }}" }' |