From cfd7a961075f5d7bc682952134a0a1d25c714ff2 Mon Sep 17 00:00:00 2001 From: LizBaker <39655074+LizBaker@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:20:17 -0700 Subject: [PATCH] Expand attribute dictionary comment action (#16742) * chore: Expand attribute dictionary comment action --- .../attribute-dictionary-comment.yml | 33 ------------ .github/workflows/protected-file-comment.yml | 52 +++++++++++++++++++ 2 files changed, 52 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/attribute-dictionary-comment.yml create mode 100644 .github/workflows/protected-file-comment.yml diff --git a/.github/workflows/attribute-dictionary-comment.yml b/.github/workflows/attribute-dictionary-comment.yml deleted file mode 100644 index 50dc743aaa1..00000000000 --- a/.github/workflows/attribute-dictionary-comment.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Attribute dictionary updates - -on: - pull_request: - branches: - - develop - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - deny-attribute-dictionary-changes: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Prevent file change - uses: xalvarez/prevent-file-change-action@v1.5.1 - with: - githubToken: ${{ secrets.GITHUB_TOKEN }} - pattern: .*attribute-dictionary\.json$ - trustedAuthors: svc-docs-eng-opensource-bot - - - name: Comment if JSON file is modified - if: failure() - uses: thollander/actions-comment-pull-request@v2 - with: - message: | - > [!WARNING] - > `attribute-dictionary.json` is an autogenerated file. - > - > Changes to attribute dictionary should be made through the `attribute-dictionary` repo in GHE. diff --git a/.github/workflows/protected-file-comment.yml b/.github/workflows/protected-file-comment.yml new file mode 100644 index 00000000000..70487eec21d --- /dev/null +++ b/.github/workflows/protected-file-comment.yml @@ -0,0 +1,52 @@ +name: Protected file updates + +on: + pull_request: + branches: + - develop + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + deny-protected-file-changes: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Prevent attribute dictionary file change + id: attribute-dictionary + uses: xalvarez/prevent-file-change-action@v1.5.1 + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} + pattern: .*attribute-dictionary\.json$ + trustedAuthors: svc-docs-eng-opensource-bot + + - name: Prevent ruby config file change + id: ruby-config + uses: xalvarez/prevent-file-change-action@v1.5.1 + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} + pattern: .*src/content/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration.mdx + trustedAuthors: newrelic-ruby-agent-bot,kaylareopelle,hannahramadan,tannalynn,fallwith + + - name: Comment if JSON file is modified + if: ${{ failure() && steps.attribute-dictionary.outcome == 'failure' }} + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + > [!WARNING] + > `attribute-dictionary.json` is an autogenerated file. + > + > Changes to attribute dictionary should be made through the `attribute-dictionary` repo in GHE. + + - name: Comment if ruby config file is modified + if: ${{ failure() && steps.ruby-config.outcome == 'failure' }} + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + > [!WARNING] + > `ruby-agent-configuration.mdx` is an autogenerated file. + > + > To change the Ruby agent configuration file, please submit an issue or open a PR in the [`newrelic/newrelic-ruby-agent`](https://github.com/newrelic/newrelic-ruby-agent) repo.