Skip to content

Conversation

rohun-apex
Copy link

@rohun-apex rohun-apex commented Sep 15, 2025

Problem

The below code block will checkout ansible-lint at main. Proof: Using ansible-lint ref: main will show up in the GHA (see "Was" section of verification below). Expected: it should checkout ansible-lint at v25.8.2.

  jobs:
  build:
    name: Ansible Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run ansible-lint
        uses: ansible/[email protected]

Explanation

This is believed to be because of a long-standing bug for github variables in a composite action (see below linked issues), which this action.yml seems to be. Given that root bug hasn't been fixed since 2023, it effectively becomes a bug manifested in ansible-lint.

Following a similar example to actions/runner#2525 , I have renamed that variable so it gets around the bug in GHAs.

Verification

Was:

  1. GHA will checkout main despite specifying the tag to use (see top line of image).
image

Is:

  1. GHA will checkout the tag that is referenced (top line ref specified matches bottom ref it will check out).
image

@rohun-apex rohun-apex requested a review from a team as a code owner September 15, 2025 20:50
@rohun-apex rohun-apex changed the title fix-github-action-ref-doesnt-checkout-that-ref (fix): github action ref doesn't checkout that ref Sep 15, 2025
@rohun-apex rohun-apex changed the title (fix): github action ref doesn't checkout that ref fix: github action ref doesn't checkout that ref Sep 15, 2025
@github-actions github-actions bot added the fix label Sep 15, 2025
@Qalthos Qalthos force-pushed the fix-github-action-ref-doesnt-checkout-that-ref branch from 7633986 to a05ce5d Compare October 2, 2025 12:34
@github-actions github-actions bot added fix and removed fix labels Oct 2, 2025
@Qalthos Qalthos force-pushed the fix-github-action-ref-doesnt-checkout-that-ref branch from a05ce5d to 7eb2d81 Compare October 6, 2025 12:24
@github-actions github-actions bot added fix and removed fix labels Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants