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

Tags are not set correctly #211

Closed
GROwen opened this issue Oct 24, 2023 · 0 comments · Fixed by #212
Closed

Tags are not set correctly #211

GROwen opened this issue Oct 24, 2023 · 0 comments · Fixed by #212
Assignees

Comments

@GROwen
Copy link
Contributor

GROwen commented Oct 24, 2023

Describe the bug

When GitHub Actions executes the build-deploy workflow the container images should be tagged according to the expected behaviour

To Reproduce

Background (prerequisites)
Patched version of ACT
Clone this branch and run sudo make install then point the following commands and the resulting binary i.e. $HOME/go/src/github.com/nektos/act/dist/local/act

Testing workflow event files
Execute the build-deploy workflow

workflow-dispatch.yml

{
  "inputs": null,
  "ref": "5.x",
  "repo": "dpc-sdp/bay",
  "sender": "GROwen",
  "workflow": "test-context-values"
}
pull_request.json

{
  "pull_request": {
    "head": {
      "ref": "build/DDS-1723--sample"
    },
    "base": {
      "ref": "5.x"
    },
    "merged": false
  }
}

Steps to reproduce the behavior:

Execute the following commands adjusting the inputs based on the scenario

$HOME/go/src/github.com/nektos/act/dist/local/act workflow_dispatch -W .github/workflows/build-deploy.yml --defaultbranch "5.x" --actor "GROwen" -s GITHUB_TOKEN --var BRANCHES='["5.x"]' --var IMAGES='["ci-builder"]' --env REGISTRY=ghcr.io --container-architecture linux/amd64 --rm -P ubuntu-latest=catthehacker/ubuntu:act-latest -e .github/pull_request.json

You can also use the test-context-values.yml to check the GitHub context (ghc) that act computes for each run.

---
test-context-values.yml

name: test-context-values
run-name: Test cases for workflow triggers
on:
  pull_request:
    types:
      - closed
      - opened
      - synchronize
  schedule:
    - cron: '23 20 * * 0'
  workflow_dispatch:
jobs:
  github_context:
    runs-on: ubuntu-latest
    steps:
      - name: Dump GitHub context
        env:
          GITHUB_CONTEXT: ${{ toJson(github) }}
        run: echo "$GITHUB_CONTEXT"

Expected behavior

Scenarios

item workflow trigger Event Expected tag Notes
1 pull_request opened pr-86  
2 pull_request synchronize pr-86  
3 pull_request closed base branch GITHUB_REF i.e. 5.x Future state: delete pr tag
4 schedule   Default branch GITHUB_REF i.e. 5.x  
5 workflow_dispatch workflow_dispatch - request specifics - create-a-workflow-dispatch-event  GITHUB_REF i.e. 5.x

Additional context

Add any other context about the problem here.

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 a pull request may close this issue.

1 participant