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

Ability to add a step to a job #71

Closed
TWiStErRob opened this issue Jan 26, 2024 · 0 comments · Fixed by #72
Closed

Ability to add a step to a job #71

TWiStErRob opened this issue Jan 26, 2024 · 0 comments · Fixed by #72
Assignees
Labels
enhancement New feature or request

Comments

@TWiStErRob
Copy link
Contributor

Feature request
I would like to insert a step into a workflow from a test.

I think this syntax would work:

      mockSteps: {
        "job-name": [
          {
            before: N, // or after: N,
            mockWith: {...}
          }
        ]
      }

Additional context
When testing local actions, we need to clone the MockGithub repository, but in production we don't need this and we don't want to create noise in the real executions by doing an if: ... or having a placeholder step to replace with mock.

Workaround
For now I did this:

      # "Placeholder for test to hook into."
      - id: checkout
        run: |
          true

+

      mockSteps: {
        "job-name": [
          {
            id: "checkout",
            mockWith: {
              name: "Checkout (test only)"
              uses: "actions/checkout@v4",
              run: undefined,
            }
          }
        ]
      }

Proposed solution

No yaml changes.
+

      mockSteps: {
        "job-name": [
          {
            before: 0,
            mockWith: {
              name: "Checkout (test only)"
              uses: "actions/checkout@v4",
            }
          }
        ]
      }
@shubhbapna shubhbapna added the enhancement New feature or request label Jan 30, 2024
@shubhbapna shubhbapna self-assigned this Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants