Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dependabot creates multiple changesets #2710

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

nedsalk
Copy link
Contributor

@nedsalk nedsalk commented Jul 5, 2024

Checklist

  • I addedtests to prove my changes
  • I updated — all the necessary docs
  • I reviewed — the entire PR myself, using the GitHub UI
  • I described — all breaking changes and the Migration Guide

@nedsalk nedsalk added the bug Issue is a bug label Jul 5, 2024
@nedsalk nedsalk self-assigned this Jul 5, 2024
@nedsalk nedsalk changed the title Ns/fix/dependabot duplicate changeset fix: dependabot creates multiple changesets Jul 5, 2024
@nedsalk nedsalk enabled auto-merge (squash) July 5, 2024 18:07
@arboleya arboleya added this to the 0.x mainnet milestone Jul 5, 2024
Copy link
Contributor

github-actions bot commented Jul 5, 2024

Coverage Report:

Lines Branches Functions Statements
79.62%(+0%) 71.4%(+0%) 77.28%(+0%) 79.71%(+0%)
Changed Files:

Coverage values did not change👌.

Copy link
Member

@maschad maschad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with these changes, but perhaps we could avoid the repetitive if: env.CHANGESET_FILE == '' checks by doing a check for that as a job, and then having create-changset job dependent on it.

Something like

check-changeset:
    name: Check for Changeset
    runs-on: ubuntu-latest
    outputs:
      changeset_exists: ${{ steps.check_changeset.outputs.exists }}
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          ref: ${{ github.event.client_payload.ref }}

      - name: Check for PR's changeset file
        id: check_changeset
        run: |
          CHANGESET_FILE=$(git diff --diff-filter=A --name-only origin/${{ github.base_ref }} .changeset/*.md)
          if [ -z "$CHANGESET_FILE" ]; then
            echo "exists=false" >> $GITHUB_OUTPUT
          else
            echo "exists=true" >> $GITHUB_OUTPUT
          fi

and then the create-changeset would have the conditional

if: github.actor == 'dependabot[bot]' && needs.check-changeset.outputs.changeset_exists == 'false'

@nedsalk nedsalk merged commit 2f1a650 into master Jul 5, 2024
30 checks passed
@nedsalk nedsalk deleted the ns/fix/dependabot-duplicate-changeset branch July 5, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dependabot creates duplicate changesets for CI deps
4 participants