-
-
Notifications
You must be signed in to change notification settings - Fork 3
29 lines (27 loc) · 830 Bytes
/
push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: Test CI
on:
push:
jobs:
status:
runs-on: ubuntu-latest
name: Test commit status
steps:
- name: Fetch the last commit in the PR
id: sha
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const sha = github.sha;
console.log(context.issue, github);
const { owner, repo } = context.issue;
const status = await github.request(`POST /repos/${owner}/${repo}/statuses/${sha}`, {
owner,
repo,
sha,
state: 'success',
target_url: 'https://example.com/build/status',
description: 'The build succeeded!',
context: 'continuous-integration/jenkins'
});
return status.data.head.sha