pulumi/.github/workflows
Bryce Lampe d83d06faaf
ci: Fix ci-ok check on merge (#13750)
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

I'm not sure why `success()` and `failure()` don't work as expected
here, but the [needs
context](https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context)
does do what we want.

Previously, if the CI job failed the job `ci-ok` job would still pass:
```
❯ act --detect-event
WARN  ⚠ You are using Apple M-series chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠
[Merge/info] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/info]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/info]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/info]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/info]  Run Main exit 0
[Merge/info]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/info]     Success - Main exit 0
[Merge/info] 🏁  Job succeeded
[Merge/CI  ] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/CI  ]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/CI  ]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/CI  ]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/CI  ]  Run Main exit 1
[Merge/CI  ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/CI  ]     Failure - Main exit 1
[Merge/CI  ] exitcode '1': failure
[Merge/CI  ] 🏁  Job failed
[Merge/ci-ok  ] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/ci-ok  ]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/ci-ok  ]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/ci-ok  ]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/ci-ok  ]  Run Main CI succeeded
[Merge/ci-ok  ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1.sh] user= workdir=
[Merge/ci-ok  ]     Success - Main CI succeeded
[Merge/ci-ok  ] 🏁  Job succeeded
Error: Job 'CI' failed
```

Now if CI fails we also see `ci-ok` fail as expected:
```
❯ act --detect-event
WARN  ⚠ You are using Apple M-series chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠
[Merge/info] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/info]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/info]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/info]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/info]  Run Main exit 0
[Merge/info]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/info]     Success - Main exit 0
[Merge/info] 🏁  Job succeeded
[Merge/CI  ] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/CI  ]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/CI  ]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/CI  ]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/CI  ]  Run Main exit 1
[Merge/CI  ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/CI  ]     Failure - Main exit 1
[Merge/CI  ] exitcode '1': failure
[Merge/CI  ] 🏁  Job failed
[Merge/ci-ok  ] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/ci-ok  ]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/ci-ok  ]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/ci-ok  ]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/ci-ok  ]  Run Main Release failed
[Merge/ci-ok  ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/ci-ok  ]     Failure - Main Release failed
[Merge/ci-ok  ] exitcode '1': failure
[Merge/ci-ok  ] 🏁  Job failed
Error: Job 'CI' failed
```

If release fails:
```
WARN  ⚠ You are using Apple M-series chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠
[Merge/info] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/info]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/info]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/info]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/info]  Run Main exit 0
[Merge/info]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/info]     Success - Main exit 0
[Merge/info] 🏁  Job succeeded
[Merge/CI  ] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/CI  ]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/CI  ]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/CI  ]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/CI  ]  Run Main exit 0
[Merge/CI  ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/CI  ]     Success - Main exit 0
[Merge/CI  ] 🏁  Job succeeded
[Merge/prepare] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/prepare]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/prepare]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/prepare]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/prepare]  Run Main exit 1
[Merge/prepare]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/prepare]     Failure - Main exit 1
[Merge/prepare] exitcode '1': failure
[Merge/prepare] 🏁  Job failed
[Merge/ci-ok  ] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/ci-ok  ]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/ci-ok  ]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/ci-ok  ]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/ci-ok  ]  Run Main Release failed
[Merge/ci-ok  ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1.sh] user= workdir=
[Merge/ci-ok  ]     Failure - Main Release failed
[Merge/ci-ok  ] exitcode '1': failure
[Merge/ci-ok  ] 🏁  Job failed
Error: Job 'prepare' failed
```

And if everything passes:
```
❯ act --detect-event && echo success
WARN  ⚠ You are using Apple M-series chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠
[Merge/info] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/info]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/info]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/info]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/info]  Run Main exit 0
[Merge/info]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/info]     Success - Main exit 0
[Merge/info] 🏁  Job succeeded
[Merge/CI  ] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/CI  ]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/CI  ]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/CI  ]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/CI  ]  Run Main exit 0
[Merge/CI  ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/CI  ]     Success - Main exit 0
[Merge/CI  ] 🏁  Job succeeded
[Merge/prepare] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/prepare]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/prepare]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/prepare]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/prepare]  Run Main exit 0
[Merge/prepare]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0.sh] user= workdir=
[Merge/prepare]     Success - Main exit 0
[Merge/prepare] 🏁  Job succeeded
[Merge/ci-ok  ] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Merge/ci-ok  ]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Merge/ci-ok  ]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/ci-ok  ]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Merge/ci-ok  ]  Run Main CI succeeded
[Merge/ci-ok  ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2.sh] user= workdir=
[Merge/ci-ok  ]     Success - Main CI succeeded
[Merge/ci-ok  ] 🏁  Job succeeded
```

Fixes #13741

## Checklist

- [ ] I have run `make tidy` to update any new dependencies
- [ ] I have run `make lint` to verify my code passes the lint check
  - [ ] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-08-21 23:04:33 +00:00
..
ci-build-binaries.yml ci(test): Fix setup-go caching 2023-07-06 11:59:22 -07:00
ci-build-sdks.yml CI: Node 14 => Node 16 2023-05-09 17:02:08 -04:00
ci-info.yml ci: Update post-release PR to align with release process 2022-10-18 22:45:59 -07:00
ci-lint.yml ci: Remove Bors (#13715) 2023-08-12 01:36:48 +00:00
ci-prepare-release.yml feat: sign pulumi binaries with cosign 2022-12-16 09:32:51 -08:00
ci-run-test.yml ci/goteststats: Update repository location 2023-08-10 13:54:14 -07:00
ci-test-docs-generation.yml Pin the docs-generation preview to AWS 5.42.0 2023-08-11 08:33:08 -07:00
ci.yml ci: Include Go and NodeJS hosts in unit tests 2023-06-29 14:51:05 -07:00
command-dispatch.yml ci: ensure trunk is always green 2022-09-13 13:38:14 -07:00
download-pulumi-cron.yml Fix Download Pulumi Cron workflow 2023-03-17 16:38:38 -07:00
on-community-pr.yml ci: fix community contributor workflows 2022-09-21 17:39:15 -07:00
on-merge.yml ci: Fix ci-ok check on merge (#13750) 2023-08-21 23:04:33 +00:00
on-pr-changelog.yml ci: fix community contributor workflows 2022-09-21 17:39:15 -07:00
on-pr-default.yml Fix regex 2023-03-23 11:31:31 -04:00
on-pr.yml ci: No-op to test merge queue (#13744) 2023-08-21 18:34:09 +00:00
on-release.yml ci: Update post-release PR to align with release process 2022-10-18 22:45:59 -07:00
periodic-coverage.yml ci(new workflow): Run tests on master every 12 hours 2023-06-29 15:58:48 -07:00
pr-test-acceptance-on-dispatch.yml ci: Don't upload coverage artifacts on PRs 2023-08-09 09:56:08 -07:00
pr-test-docs-gen-on-pr.yml ci: Clean up excess permissions, fix acceptance tests job 2022-09-15 17:48:16 -07:00
pr-test-docs-generation-on-dispatch.yml Replace deprecated command with environment file 2023-02-20 11:14:39 +09:00
rebase.yml ci/rebase: Run for members and owners 2023-02-19 18:18:06 -08:00
release-homebrew-tap.yml ci: Enable gh cli in every step of job 2022-10-04 23:23:43 -07:00
release-pr.yml ci: Remove Bors (#13715) 2023-08-12 01:36:48 +00:00
release.pub ci: ensure trunk is always green 2022-09-13 13:38:14 -07:00
release.yml Don't dispatch the smoke-test-cli workflow to pulumi/examples on release 2023-08-04 13:28:36 -07:00
trigger-homebrew-event.yml ci: Reenable Brew publishing after GH runners removed brew from path 2022-09-27 11:10:38 -07:00
trigger-release-docs-event.yml Enable command dispatch workflow for dealing with PRs (#5851) 2020-12-07 19:29:04 +00:00