fix workflow triggering condition (#136)
* fix workflow triggering condition * fix run
This commit is contained in:
parent
21f09ab91e
commit
7d7340c124
9 changed files with 34 additions and 6 deletions
4
.github/workflows/codeflash-optimize.yaml
vendored
4
.github/workflows/codeflash-optimize.yaml
vendored
|
|
@ -1,9 +1,11 @@
|
|||
name: CodeFlash
|
||||
|
||||
on:
|
||||
# Use pull_request_target for everything to ensure access to secrets
|
||||
pull_request_target:
|
||||
paths:
|
||||
- "**"
|
||||
- '**' # Trigger for all paths
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
name: end-to-end-test
|
||||
|
||||
on:
|
||||
# Use pull_request_target for everything to ensure access to secrets
|
||||
pull_request_target:
|
||||
paths:
|
||||
- '**' # Trigger for all paths
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
name: end-to-end-test
|
||||
|
||||
on:
|
||||
# Use pull_request_target for everything to ensure access to secrets
|
||||
pull_request_target:
|
||||
paths:
|
||||
- '**' # Trigger for all paths
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
name: Coverage E2E
|
||||
|
||||
on:
|
||||
# Use pull_request_target for everything to ensure access to secrets
|
||||
pull_request_target:
|
||||
paths:
|
||||
- '**' # Trigger for all paths
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
name: end-to-end-test
|
||||
|
||||
on:
|
||||
# Use pull_request_target for everything to ensure access to secrets
|
||||
pull_request_target:
|
||||
paths:
|
||||
- '**' # Trigger for all paths
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
name: end-to-end-test
|
||||
|
||||
on:
|
||||
# Use pull_request_target for everything to ensure access to secrets
|
||||
pull_request_target:
|
||||
paths:
|
||||
- '**' # Trigger for all paths
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
name: end-to-end-test
|
||||
|
||||
on:
|
||||
# Use pull_request_target for everything to ensure access to secrets
|
||||
pull_request_target:
|
||||
paths:
|
||||
- '**' # Trigger for all paths
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
name: end-to-end-test
|
||||
|
||||
on:
|
||||
# Use pull_request_target for everything to ensure access to secrets
|
||||
pull_request_target:
|
||||
paths:
|
||||
- '**' # Trigger for all paths
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
@ -23,7 +27,7 @@ jobs:
|
|||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Validate PR
|
||||
- name: Validate PR for workflow changes
|
||||
run: |
|
||||
# Check for any workflow changes
|
||||
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
|
||||
|
|
@ -34,8 +38,8 @@ jobs:
|
|||
# Allowlist check
|
||||
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
|
||||
echo "✅ Authorized user ($AUTHOR). Proceeding."
|
||||
elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]]; then
|
||||
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
|
||||
elif [[ "${{ github.event.pull_request.state }}" == "open" ]]; then
|
||||
echo "✅ PR is open. Assuming protection rules are in place. Proceeding."
|
||||
else
|
||||
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
|
||||
exit 1
|
||||
|
|
|
|||
4
.github/workflows/label-workflow-changes.yml
vendored
4
.github/workflows/label-workflow-changes.yml
vendored
|
|
@ -24,9 +24,9 @@ jobs:
|
|||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
|
||||
|
||||
const labelExists = labels.data.some(label => label.name === labelName);
|
||||
|
||||
|
||||
if (!labelExists) {
|
||||
// Create the label if it doesn't exist
|
||||
await github.rest.issues.createLabel({
|
||||
|
|
|
|||
Loading…
Reference in a new issue