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

[infra] Adds order id validation action #13957

Merged
merged 4 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/order-id-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Order ID validation

on:
issues:
types: [opened]

jobs:
validate-order-id:
runs-on: ubuntu-latest
name: Label issue based on order ID
steps:
- uses: actions/checkout@v3
- name: Label issue
uses: actions/github-script@v7
with:
script: |
const script = require('./scripts/orderIdValidation.js')
await script(core, github)
env:
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORDER_API_TOKEN: ${{ secrets.SHOP_AUTH_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

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

@hasdfa we have the following keys in use today

https://store-wp.mui.com/wp-admin/admin.php?page=wc-settings&tab=advanced&section=keys

It feels like we should create a new one specifically for GitHub Actions so we can reduce disruption in case of a security leak. How about we make the change?

@michelengelen which key did you use?

Copy link
Member Author

Choose a reason for hiding this comment

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

@oliviertassinari I did use the one from the private toolpad app

Copy link
Member

@oliviertassinari oliviertassinari Aug 25, 2024

Choose a reason for hiding this comment

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

Ok, I have created an organization secret for the GitHub action, easier to rotate this way.

Copy link
Member

@oliviertassinari oliviertassinari Aug 28, 2024

Choose a reason for hiding this comment

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

I broke the GitHub Action with this token change.

We are back up and running with 113a612, e.g. #14380 as a proof. With this change:

  • It now shows a clear error. This will be helpful in the future when our token gets revoked:
SCR-20240828-upvz

Source: https://github.com/oliviertassinari/mui-x/actions/runs/10604955513/job/29392734749

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
"clean:node_modules": "rimraf --glob \"**/node_modules\""
},
"devDependencies": {
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@argos-ci/core": "^2.4.0",
"@babel/cli": "^7.24.8",
"@babel/core": "^7.24.9",
Expand Down
146 changes: 146 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading