chore(ci): Only dry run a release, and only publish github pages, when ci workflow is triggered from main smithy-rs repository (#3663)

Similar to https://github.com/smithy-lang/smithy-rs/pull/3597.

Only run these two workflows when they are triggered from the
`smithy-lang/smithy-rs` repository, not from any fork.

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->

The scheduled dry run fails daily in forks, failing each time,
triggering alerts to the owner of the fork repository.

The github pages publishing workflow does not run regularly in forks,
but does run when a fork is synced. It would be undesirable for an
arbitrary fork to publish.

## Description
<!--- Describe your changes in detail -->

On each of the two github workflows, add an `if` condition testing the
repository owner and name. Only run if it matches the official
repository, and is not a fork.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
n/a

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

n/a in both cases
----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
This commit is contained in:
iamjpotts 2024-05-24 12:51:47 -04:00 committed by GitHub
parent 59ad183db8
commit ab74d87646
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@ on:
jobs:
smithy-rs-scheduled-dry-run-release:
name: Scheduled dry-run release
if: github.repository == 'smithy-lang/smithy-rs'
uses: ./.github/workflows/release.yml
with:
commit_sha: main

View File

@ -17,6 +17,7 @@ concurrency:
jobs:
build-and-deploy-docs:
if: github.repository == 'smithy-lang/smithy-rs'
runs-on: ubuntu-latest
steps:
- name: Checkout