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

WIP: Github Actions: Fix "Get changed files" in Shellcheck workflow #1422

Closed

Conversation

andygrunwald
Copy link
Contributor

✍️ Description

The Shellcheck GitHub Action workflow is not running. It throws an error in the "Get changed files" step:

Run if true; then
fatal: ambiguous argument 'HEAD^1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

See https://github.com/community-scripts/ProxmoxVE/actions/runs/12724031265/job/35469760341

This Pull Request is using the same "Get changes files" logic from another workflow:

- name: Get changed files
id: changed-files
run: |
if ${{ github.event_name == 'pull_request_target' }}; then
echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | xargs)" >> $GITHUB_OUTPUT
else
echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
fi

Work in Progress!

This Pull Request is work in progress as the testing can only be done via Github actions.
I will comment, once this is ready.


🛠️ Type of Change

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change unexpectedly)
  • New script (a fully functional and thoroughly tested script or set of scripts)

✅ Prerequisites

  • Self-review performed (I have reviewed my code to ensure it follows established patterns and conventions.)
  • Testing performed (I have thoroughly tested my changes and verified expected functionality.)
  • Documentation updated (I have updated any relevant documentation)

📋 Additional Information (optional)

An alternative would be to use https://github.com/marketplace/actions/changed-files instead of custom crafted shell scripts.

@github-actions github-actions bot added the maintenance Code maintenance or general upkeep of the project label Jan 11, 2025
@github-actions github-actions bot added the update script A change that updates a script label Jan 11, 2025
@andygrunwald
Copy link
Contributor Author

Superseeded by #1423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Code maintenance or general upkeep of the project update script A change that updates a script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant