Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ko3n1g committed May 6, 2024
1 parent 31825a5 commit a1b346c
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
- synchronize
paths-ignore:
- '**.md'
issue_comment:
types: [created]
workflow_dispatch:
inputs:
PUBLISH:
Expand Down Expand Up @@ -66,8 +68,20 @@ env:
DEFAULT_MANIFEST_ARTIFACT_NAME: bumped-manifest

jobs:
pre-flight:
runs-on: ubuntu-22.04
if: >
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains(github.event.comment.body, '/cicd')
steps:
- name: Triggered by comment
shell: bash
run: exit 0

metadata:
runs-on: ubuntu-22.04
needs: pre-flight
outputs:
BUILD_DATE: ${{ steps.date.outputs.BUILD_DATE }}
PUBLISH: ${{ steps.if-publish.outputs.PUBLISH }}
Expand All @@ -77,15 +91,15 @@ jobs:
MERGE_BUMPED_MANIFEST: ${{ steps.manifest-branch.outputs.MERGE_BUMBED_MANIFEST }}
TEST_SUBSET: ${{ steps.testset.outputs.TEST_SUBSET }}
steps:
- name: Cancel workflow run if the trigger is a draft PR
id: cancel-if-draft
if: github.event_name == 'pull_request' && github.event.pull_request.draft == true
run: |
echo "Cancelling workflow for draft PR"
curl -X POST -H "Authorization: token ${{ github.token }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
while true; do sleep 1; done # blocks execution in case workflow cancellation takes time
# - name: Cancel workflow run if the trigger is a draft PR
# id: cancel-if-draft
# if: github.event_name == 'pull_request' && github.event.pull_request.draft == true
# run: |
# echo "Cancelling workflow for draft PR"
# curl -X POST -H "Authorization: token ${{ github.token }}" \
# -H "Accept: application/vnd.github.v3+json" \
# "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
# while true; do sleep 1; done # blocks execution in case workflow cancellation takes time

- name: Set build date
id: date
Expand Down

0 comments on commit a1b346c

Please sign in to comment.