Skip to content

Commit

Permalink
use the branch_name as the default for the optional commit hash
Browse files Browse the repository at this point in the history
There was an issue with the script when passing optional rustfmt configs
without specifying a commit hash. Because these optional values are
passed via positional arguments the configs ($4)  would be used in place
of the commit hash ($3). Now that we set a default value for the
optional commit hash we avoid this problem.
  • Loading branch information
ytmimi authored and calebcartwright committed Jul 12, 2023
1 parent e5c212b commit d698bf4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
rustup target add x86_64-unknown-linux-gnu
- name: check diff
run: bash ${GITHUB_WORKSPACE}/ci/check_diff.sh ${{ github.event.inputs.clone_url }} ${{ github.event.inputs.branch_name }} ${{ github.event.inputs.commit_hash }} ${{ github.event.inputs.rustfmt_configs }}
run: bash ${GITHUB_WORKSPACE}/ci/check_diff.sh ${{ github.event.inputs.clone_url }} ${{ github.event.inputs.branch_name }} ${{ github.event.inputs.commit_hash || github.event.inputs.branch_name }} ${{ github.event.inputs.rustfmt_configs }}
2 changes: 1 addition & 1 deletion ci/check_diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function compile_rustfmt() {
git fetch feature $FEATURE_BRANCH

cargo build --release --bin rustfmt && cp target/release/rustfmt $1/rustfmt
if [ -z "$OPTIONAL_COMMIT_HASH" ]; then
if [ -z "$OPTIONAL_COMMIT_HASH" ] || [ "$FEATURE_BRANCH" = "$OPTIONAL_COMMIT_HASH" ]; then
git switch $FEATURE_BRANCH
else
git switch $OPTIONAL_COMMIT_HASH --detach
Expand Down

0 comments on commit d698bf4

Please sign in to comment.