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: Use include-workspace-root for /main in Post Dependabot #462

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

hashtagchris
Copy link
Contributor

@hashtagchris hashtagchris commented Jul 17, 2024

steps.metadata.outputs.directory is set to /main, not /, when package.json is at the root of the repository. I suspect adding target-branch to dependabot.yml (#330) added a main segment to Dependabot PR branch names, which changed the value of steps.metadata.outputs.directory.

By fixing this issue, we shouldn't need to routinely use stafftools to fix up template-oss Dependabot PRs. 🤞🏼

I couldn't quickly find a bump @npmcli/template-oss Dependabot PR for a workspace to inspect steps.metadata.outputs.directory and fix workspaces support. If that's important, we may want to either enable Dependabot for npm/cli or create a separate template-oss-test repo. It's not clear if Dependabot will create a PR for workspace/test-workspace upon our next release.

Example Dependabot PR branch names

The first PR updates just @npmcli/template-oss. The second updates multiple dependencies including @npmcli/template-oss.

PR branch name segments steps.metadata.outputs.directory
npm/agent#110 dependabot/npm_and_yarn/main/npmcli/template-oss-4.23.0 5 /main
npm/statusboard#877 dependabot/npm_and_yarn/main/dependency-updates-4de8b5bfcf 4 /

References

Failed "Post Dependabot" run: https://github.com/npm/agent/actions/runs/9963674341/job/27530225303

Fix manually tested here: npm/agent@ef85b08

branchNameToDirectoryName

Bug report: dependabot/fetch-metadata#540

@hashtagchris hashtagchris requested a review from a team as a code owner July 17, 2024 04:32
@hashtagchris hashtagchris changed the title fix: Use include-workspace-root for target branch in post-dependabot.yml fix: Use include-workspace-root for /main in post-dependabot.yml Jul 17, 2024
@hashtagchris hashtagchris changed the title fix: Use include-workspace-root for /main in post-dependabot.yml fix: Use include-workspace-root for /main in Post Dependabot Jul 17, 2024
@hashtagchris hashtagchris force-pushed the hashtagchris-dependabot-outputs-directory branch from eff36c1 to cd4f1a4 Compare July 17, 2024 04:50
@wraithgar
Copy link
Member

stafftools will still need to be ran on dependabot PRs that update .github/workflows since dependabot PRs don't have access to push to that directory.

@hashtagchris hashtagchris merged commit ca47705 into main Jul 17, 2024
24 checks passed
@hashtagchris hashtagchris deleted the hashtagchris-dependabot-outputs-directory branch July 17, 2024 15:09
@github-actions github-actions bot mentioned this pull request Jul 17, 2024
wraithgar pushed a commit that referenced this pull request Jul 17, 2024
🤖 I have created a release *beep* *boop*
---


##
[4.23.1](v4.23.0...v4.23.1)
(2024-07-17)

### Bug Fixes

*
[`ca47705`](ca47705)
[#462](#462) Use
`include-workspace-root` for `/main` in Post Dependabot (#462)
(@hashtagchris)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants