Skip to content

ok-to-test-command #533

ok-to-test-command

ok-to-test-command #533

Workflow file for this run

name: default
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
repository_dispatch:
types: [ok-to-test-command]
jobs:
default:
runs-on:
- self-hosted
- generic
permissions:
pull-requests: write
checks: write
if: github.event_name == 'repository_dispatch' && contains(github.event.client_payload.pull_request.head.sha)

Check failure on line 16 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / default

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yaml (Line: 16, Col: 9): Too few parameters supplied: '('. Located at position 55 within expression: github.event_name == 'repository_dispatch' && contains(github.event.client_payload.pull_request.head.sha)
steps:
- run: |
echo "Integration tests... success! ;-)"
- name: Slack Notify
uses: slackapi/slack-github-action@v1
with:
channel-id: proj-talos-maintainers
payload: |
{
"attachments": [
{
"color": "#2EB886",
"fallback": "test",
"blocks": [
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "pull_request"
},
{
"type": "mrkdwn",
"text": "*Status:*\n"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Author:*\n`${{ github.actor }}`"
},
{
"type": "mrkdwn",
"text": "*Event:"
}
]
},
{
"type": "divider"
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Logs"
},
"url": ""
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Commit"
},
"url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}"
}
]
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- uses: actions/github-script@v6
id: update-check-run
if: ${{ always() }}
env:
number: ${{ github.event.client_payload.pull_request.number }}
job: ${{ github.job }}
# Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run
conclusion: ${{ job.status }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pull } = await github.rest.pulls.get({
...context.repo,
pull_number: process.env.number
});
const ref = pull.head.sha;
const { data: checks } = await github.rest.checks.listForRef({
...context.repo,
ref
});
const check = checks.check_runs.filter(c => c.name === process.env.job);
const { data: result } = await github.rest.checks.update({
...context.repo,
check_run_id: check[0].id,
status: 'completed',
conclusion: process.env.conclusion
});
return result;