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

GH Action Errors due to customization being run as a workflow #1435

Closed
andrewdavidmackenzie opened this issue Sep 29, 2024 · 2 comments
Closed

Comments

@andrewdavidmackenzie
Copy link

I have customized my GH Action for releases following your great docs, here:
https://github.com/andrewdavidmackenzie/pigg/blob/master/.github/workflows/release.yml

That references this custom install yaml to install linkers for cross compiling
https://github.com/andrewdavidmackenzie/pigg/blob/master/.github/workflows/install-arm-linkers.yml

It all works in release, but GH reports errors as it tries to run that file as a workflow at other times.

Here is an example GH Action run:
https://github.com/andrewdavidmackenzie/pigg/actions/runs/11083791483

How can I avoid GH Actions doing that and getting those false error reports?

@KtorZ
Copy link

KtorZ commented Oct 2, 2024

The path to the custom steps file specified in the workspace configuration is relative to the .github/workflows directory. So, move the custom steps up out of the workflows directory to prevent Github from interpreting as a workflow configuration. For example, put it in the parent directory. As such:

├─ .github 
│  ├── install-arm-linkers.yml
│  └── workflows
│      └── release.yml
└── Cargo.toml

And in your Cargo.toml, add:

github-build-setup = "../install-arm-linkers.yml"

Also don't forget:

  1. You need cargo-dist >= 0.20.0 to enable this feature.
  2. Re-run cargo dist init once those steps are complete to re-generate the release.yml file and includes the custom steps.

@andrewdavidmackenzie
Copy link
Author

makes sense!
Thanks very much.

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

No branches or pull requests

2 participants