Skip to content

Conversation

@abannachGrafana
Copy link
Contributor

@abannachGrafana abannachGrafana commented Feb 7, 2025

Problem

If committing to a fast paced repo (lots of commits) there was a frequent failure that can happen because the commit oid being committed to is not the latest.

Description of fix

By using git ls-remote --heads origin <ref> we fetch the latest oid from the remote repository without having to pull all commits locally. This in theory should minimize failures since oid fetching occurs right before commit and with less time wasted pulling commits it should succeed more often than not.

Converting to a Graphql api call instead of typescript with normal api calls simplifies the action by not having to create a tree object while committing. Reducing the chance for errors since we are only passing file contents along instead of tree structures.

  • feat: convert to composite action using gh api graphql
  • Add ability to delete and rename files

@abannachGrafana abannachGrafana changed the title adam.bannach/dependency updates Feat: Convert action to use graphql mutation Feb 10, 2025
@@ -1,46 +0,0 @@
{
Copy link

Choose a reason for hiding this comment

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

So package.json is being deleted. How does the project get its dependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this is now just a composite action which doesn't pull any dependencies at all. Just runs bash commands in action.yml


- package-ecosystem: npm # This is the correct value for yarn https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
directory: /
- package-ecosystem: 'npm'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

could probably delete this, but if we ever include package.json again in the future we won't have to change dependabot settings

@abannachGrafana abannachGrafana changed the title Feat: Convert action to use graphql mutation Feat!: Convert action to use graphql mutation Feb 10, 2025
@abannachGrafana abannachGrafana merged commit 0776420 into main Feb 10, 2025
8 checks passed
@abannachGrafana abannachGrafana deleted the adam.bannach/dependency-updates branch February 10, 2025 20:17
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.

2 participants