mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 21:11:38 +01:00
Make sure yarn.lock changes are allowed for committer PRs (#120642)
* hmm * get perms * hmm * oops * hmm * cleanup
This commit is contained in:
15
.github/workflows/no-yarn-lock-changes.yml
vendored
15
.github/workflows/no-yarn-lock-changes.yml
vendored
@@ -6,9 +6,22 @@ jobs:
|
||||
name: Prevent yarn.lock changes in PRs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: file_changes
|
||||
- uses: octokit/request-action@v2.x
|
||||
id: get_permissions
|
||||
with:
|
||||
route: GET /repos/microsoft/vscode/collaborators/{username}/permission
|
||||
username: ${{ github.event.pull_request.user.login }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Set control output variable
|
||||
id: control
|
||||
run: |
|
||||
echo "::set-output name=should_run::${{ !contains(fromJson('["admin", "write"]'), fromJson(steps.get_permissions.outputs.data).permission) }}"
|
||||
- name: Get file changes
|
||||
uses: trilom/file-changes-action@ce38c8ce2459ca3c303415eec8cb0409857b4272
|
||||
if: ${{ steps.control.should_run }}
|
||||
- name: Check for yarn.lock changes
|
||||
if: ${{ steps.control.should_run }}
|
||||
run: |
|
||||
cat $HOME/files.json | jq -e '.[] | test("yarn\\.lock$") | not' \
|
||||
|| (echo "Changes to yarn.lock files aren't allowed in PRs." && exit 1)
|
||||
|
||||
Reference in New Issue
Block a user