Skip to content

Commit c6c7929

Browse files
committed
exclude some tokens dependent jobs on PRs
1 parent a6e7aca commit c6c7929

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/cmo-make-targets.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ jobs:
6262
git checkout -- jsonnet/jsonnetfile.lock.json;
6363
fi
6464
- name: Get app token for pull request creation
65+
if: github.event_name != 'pull_request'
6566
id: pr
6667
uses: actions/create-github-app-token@v3
6768
with:
6869
app-id: ${{ secrets.pr-app-id }}
6970
private-key: ${{ secrets.pr-app-private-key }}
7071
owner: openshift
7172
- name: Get app token for repository cloning
73+
if: github.event_name != 'pull_request'
7274
id: cloner
7375
uses: actions/create-github-app-token@v3
7476
with:
@@ -80,6 +82,7 @@ jobs:
8082
run: |
8183
echo sandbox="$(echo ${{ inputs.make-targets }} | sed 's/ /-/g')" >> "$GITHUB_OUTPUT"
8284
- name: Create Pull Request
85+
if: github.event_name != 'pull_request'
8386
id: create-pr
8487
uses: peter-evans/create-pull-request@v8
8588
with:
@@ -96,6 +99,7 @@ jobs:
9699
branch-token: ${{ steps.cloner.outputs.token }}
97100
maintainer-can-modify: false
98101
- name: Compose slack message body
102+
if: github.event_name != 'pull_request' && success()
99103
id: slack-message
100104
run: |
101105
if [ "${{ steps.create-pr.outputs.pull-request-url }}" == "" ]; then
@@ -107,7 +111,7 @@ jobs:
107111
fi
108112
- uses: slackapi/slack-github-action@v3
109113
continue-on-error: true
110-
if: success()
114+
if: github.event_name != 'pull_request' && success()
111115
with:
112116
webhook: ${{ secrets.slack-webhook-url }}
113117
webhook-type: incoming-webhook
@@ -120,7 +124,7 @@ jobs:
120124
}
121125
- uses: slackapi/slack-github-action@v3
122126
continue-on-error: true
123-
if: failure()
127+
if: github.event_name != 'pull_request' && failure()
124128
with:
125129
webhook: ${{ secrets.slack-webhook-url }}
126130
webhook-type: incoming-webhook

.github/workflows/merge-prometheus-operator.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
# and other generated assets stay in sync with the upstream release.
4242
check-prometheus-operator-jsonnet-pin:
4343
needs: prometheus-operator-merge
44-
# Run even if the merge job fails (e.g. due to conflicts).
44+
# Run even if the merge job fails (e.g. due to conflicts). We still need a PR anyway.
4545
if: always() && needs.prometheus-operator-merge.outputs.upstream-release != ''
4646
runs-on: ubuntu-latest
4747
outputs:
@@ -96,11 +96,12 @@ jobs:
9696
Updates the prometheus-operator jsonnet branch pin in
9797
[`jsonnet/jsonnetfile.json`](https://github.com/openshift/cluster-monitoring-operator/blob/main/jsonnet/jsonnetfile.json)
9898
to match the latest upstream release, and regenerates all
99-
assets including prometheus-operator CRDs YAMLs.
99+
assets (CRDs YAMLs, etc.).
100100
101101
Note: the [downstream openshift/prometheus-operator](https://github.com/openshift/prometheus-operator/blob/main/VERSION)
102102
may still be on an older version.
103-
That is not necessarily a blocker for this PR.
103+
That is not necessarily a blocker; in fact, landing this PR
104+
first may unblock the downstream fork bump.
104105
secrets:
105106
pr-app-id: ${{ secrets.APP_ID }}
106107
pr-app-private-key: ${{ secrets.APP_PRIVATE_KEY }}

0 commit comments

Comments
 (0)