Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,42 @@ on:
- main

jobs:
Find GitSHA:
Find-GitSHA:
name: find Git Sha
runs-on: ubuntu-latest
steps:
- name: Print commit ID
run: echo "Commit ID: $GITHUB_SHA"
- uses: actions/checkout@v1

- name: Extract commit ID and repository information
run: |
COMMIT_ID=$GITHUB_SHA
REPO_INFO=$GITHUB_REPOSITORY
echo "REPO_INFO: $REPO_INFO"
OWNER=$(echo $REPO_INFO | cut -d'/' -f1)
REPO=$(echo $REPO_INFO | cut -d'/' -f2)
echo "Commit ID: $COMMIT_ID"
echo "Repository: $REPO"
echo "Owner: $OWNER"

- name: Create commit status
run: |
API_HOST=https://api.github.com
OWNER=$(echo $GITHUB_REPOSITORY | cut -d'/' -f1)
REPO=$(echo $GITHUB_REPOSITORY | cut -d'/' -f2)
# Check out the PR branch
git checkout $GITHUB_HEAD_REF
# Get the commit ID of the last commit
COMMIT_ID=$(git rev-parse HEAD)
echo "Last commit ID of PR: $COMMIT_ID"
REF=$GITHUB_SHA
echo "Current Commit ID REF : $REF"
STATUS_URL=$API_HOST/repos/$OWNER/$REPO/statuses/$COMMIT_ID
echo "STATUS_URL: $STATUS_URL"
curl -X POST $STATUS_URL \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"state": "success",
"description": "The build was successful.",
"context": "ci/smartui-github-testing"
}'