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

ignore markdown files (e.g. README.md) for terraform deployment workflows #7374

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

tom-webber
Copy link
Contributor

@tom-webber tom-webber commented Jun 28, 2024

A reference to the issue / Description of it

No existing issue. The current github workflows for terraform deployment are triggered on changes within the terraform directories. This includes changes exclusively to README.md files, which won't affect the deployment, and shouldn't trigger the workflow.

How does this PR fix the problem?

This PR adds a - '!**.md' condition to the paths argument for the triggering actions (see including and excluding paths syntax). This means that changes to markdown files ending in .md (i.e. not html.md.erb files) will not trigger these deploy workflows.

How has this been tested?

Please describe the tests that you ran and provide instructions to reproduce.

{Please write here}

Deployment Plan / Instructions

Will this deployment impact the platform and / or services on it?

{Please write here}

Checklist (check x in [ ] of list items)

  • I have performed a self-review of my own code
  • All checks have passed
  • I have made corresponding changes to the documentation

Additional comments (if any)

{Please write here}

Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.5.0)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

@tom-webber tom-webber marked this pull request as ready for review June 28, 2024 15:35
@tom-webber tom-webber requested a review from a team as a code owner June 28, 2024 15:35
@dms1981
Copy link
Contributor

dms1981 commented Jul 1, 2024

In its current form this feels overdriven to me; setting paths to ignore any markdown, rather than only the markdown in relevant paths is efficient from a number-of-characters perspective but gets away from the purpose of the included paths. I think I'd prefer to see !/terraform/environments/$triggering-directory/**.md or something similar.

Copy link
Contributor

github-actions bot commented Jul 1, 2024

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.5.0)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

@tom-webber
Copy link
Contributor Author

In its current form this feels overdriven to me; setting paths to ignore any markdown, rather than only the markdown in relevant paths is efficient from a number-of-characters perspective but gets away from the purpose of the included paths. I think I'd prefer to see !/terraform/environments/$triggering-directory/**.md or something similar.

An advantage of the existing syntax is that it reads as 'ignore markdown files', irrespective of the directory. Another is that it avoids needlessly bulking out the paths with replication of each path (e.g. for 3 paths here, and 9 paths here <- this last one was added after your comment, as I'd missed that the modules/ folder contained readme's). The specificity of the matching comes from the positive match assertions (directories), and the ignore is filtering from that subset.

Copy link
Contributor

github-actions bot commented Jul 1, 2024

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.5.0)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

@tom-webber tom-webber added this pull request to the merge queue Jul 1, 2024
@tom-webber tom-webber merged commit 68a01fb into main Jul 1, 2024
37 of 38 checks passed
@tom-webber tom-webber deleted the ignore-md-files-for-tf-deploy-workflows branch July 1, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants