This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
Fake comment #14
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: Test Plugin | |
on: | |
pull_request: | |
types: [labeled, opened] | |
jobs: | |
trigger-jenkins: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Get pull request labels | |
id: get-labels | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const labels = context.payload.pull_request.labels.map(label => label.name); | |
return labels; | |
- name: Get Jenkins crumb | |
id: get-crumb | |
run: | | |
CRUMB=$(curl -s --user "${{ secrets.JENKINS_AUTH }}" "https://jenkins2.learningpool.com/crumbIssuer/api/json" | jq -r '.crumb') | |
echo "CRUMB=$CRUMB" >> $GITHUB_ENV | |
- name: Trigger Jenkins job if label matches | |
if: contains(steps.get-labels.outputs.result, 'run-tests') | |
run: | | |
curl --location --request POST \ | |
--url https://jenkins2.learningpool.com/view/Adapt/job/Adapt-Content-Testing/buildWithParameters \ | |
--header "Authorization: Basic ${{ secrets.JENKINS_AUTH }}" \ | |
--header "Jenkins-Crumb: ${{ env.CRUMB }}" \ | |
--data-urlencode "course=copy-of-introduction-to-adapt-master" \ | |
--data-urlencode "plugin=${{ github.event.pull_request.head.repo.name }}" \ | |
--data-urlencode "plugin_branch=${{ github.event.pull_request.head.ref }}" |