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

feat(lint): add changie validation job to lint action #83

Closed
wants to merge 49 commits into from

Conversation

sheldonhull
Copy link
Contributor

@sheldonhull sheldonhull commented Aug 12, 2024

Fixes #82

Add changie validation job to lint action.

  • Add a new job changie-validation to .github/workflows/lint.yml to check for changie entries in .changes/unreleased directory.
  • Skip the changie-validation job if the .changes directory does not exist.
  • Skip the changie-validation job if the labels no-changie-required or dependencies are set.
  • Replace deprecated set-output command with echo "{name}={value}" >> $GITHUB_OUTPUT in the changie-validation job.
  • Add a comment using the gh cli if a changie entry is required, ensuring only a single comment is made and updated if it was closed.

For more details, open the Copilot Workspace session.

Fixes #82

Add changie validation job to lint action.

* Add a new job `changie-validation` to `.github/workflows/lint.yml` to check for changie entries in `.changes/unreleased` directory.
* Skip the `changie-validation` job if the `.changes` directory does not exist.
* Skip the `changie-validation` job if the labels `no-changie-required` or `dependencies` are set.
* Replace deprecated `set-output` command with `echo "{name}={value}" >> $GITHUB_OUTPUT` in the `changie-validation` job.
* Add a comment using the gh cli if a changie entry is required, ensuring only a single comment is made and updated if it was closed.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/DelineaXPM/github-workflows/issues/82?shareId=XXXX-XXXX-XXXX-XXXX).
@sheldonhull sheldonhull requested a review from a team as a code owner August 12, 2024 23:55
@sheldonhull sheldonhull changed the title Add changie validation job to lint action feat: add changie validation job to lint action Aug 12, 2024
@sheldonhull sheldonhull changed the title feat: add changie validation job to lint action feat(lint): add changie validation job to lint action Aug 12, 2024
* Set GH_TOKEN environment variable to ${{ github.token }} for the changie-validation job to enable gh pr comment command
@sheldonhull
Copy link
Contributor Author

Add GH_TOKEN environment variable to changie-validation job

  • Set GH_TOKEN environment variable to ${{ github.token }} for the changie-validation job to enable gh pr comment command

* Add `changie-validation` job to check for changie entries in `.changes/unreleased` directory
* Skip `changie-validation` job if `.changes` directory does not exist or if labels `no-changie-required` or `dependencies` are set
* Replace deprecated `set-output` command with `echo "{name}={value}" >> $GITHUB_OUTPUT`
* Add comment using gh cli if changie entry is required, ensuring only a single comment is made
* Map `GH_TOKEN` in `env` for `check_labels` and `validate_changie_entry` steps
@sheldonhull
Copy link
Contributor Author

Add changie-validation job to lint workflow

  • Add changie-validation job to check for changie entries in .changes/unreleased directory
  • Skip changie-validation job if .changes directory does not exist or if labels no-changie-required or dependencies are set
  • Replace deprecated set-output command with echo "{name}={value}" >> $GITHUB_OUTPUT
  • Add comment using gh cli if changie entry is required, ensuring only a single comment is made
  • Map GH_TOKEN in env for check_labels and validate_changie_entry steps

@sheldonhull
Copy link
Contributor Author

Update lint.yml to fix environment variable mapping for GH_TOKEN

  • Fix environment variable mapping:
    • Remove with block and move env block directly under run for check_labels and validate_changie_entry steps
    • Ensure GH_TOKEN is correctly mapped in env for both steps

* **Fix environment variable mapping:**
  - Remove `with` block and move `env` block directly under `run` for `check_labels` and `validate_changie_entry` steps
  - Ensure `GH_TOKEN` is correctly mapped in `env` for both steps
* Add checkout step to changie-validation job to ensure the repository is checked out before running validation steps
@sheldonhull
Copy link
Contributor Author

Add checkout step to changie-validation job in lint workflow

  • Add checkout step to changie-validation job to ensure the repository is checked out before running validation steps

@sheldonhull sheldonhull enabled auto-merge (squash) August 13, 2024 00:03
@sheldonhull sheldonhull requested a review from a team as a code owner August 13, 2024 00:08
@sheldonhull sheldonhull removed the request for review from pacificcode August 13, 2024 01:23
github-actions[bot]

This comment was marked as duplicate.

@DelineaXPM DelineaXPM deleted a comment from github-actions bot Aug 13, 2024
github-actions[bot]

This comment was marked as duplicate.

github-actions[bot]
github-actions bot previously approved these changes Aug 13, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ changie entry was found

github-actions[bot]
github-actions bot previously approved these changes Aug 13, 2024
Copy link
Contributor

✅ changie entry was found

1 similar comment
Copy link
Contributor

✅ changie entry was found

@sheldonhull
Copy link
Contributor Author

tweak to echo and add more context detail

@sheldonhull
Copy link
Contributor Author

make it work

@sheldonhull
Copy link
Contributor Author

remove readme changes

auto-merge was automatically disabled August 13, 2024 02:56

Pull request was closed

sheldonhull added a commit that referenced this pull request Aug 13, 2024
Add support for automatic comment/review by github actions on linting
when changie expected to help catch it early on contributions and
improve feedback loop speed.
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 this pull request may close these issues.

adjust lint action to also perform a second job of validating that a changie entry was added
1 participant