зеркало из https://github.com/Azure/autorest.git
Consitency github action (#4505)
This commit is contained in:
Родитель
f07c0303b7
Коммит
b1e653695e
|
@ -0,0 +1,29 @@
|
|||
name: Consitency checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Use Node.js 16.x
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
- run: |
|
||||
LABEL_NAME=Publish
|
||||
LABEL_URL=https://api.github.com/repos/$BUILD_REPOSITORY_ID/issues/$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER/labels
|
||||
|
||||
echo "Getting labels using $LABEL_URL"
|
||||
if curl -s "$LABEL_URL" | grep "\"name\": \"$LABEL_NAME\""
|
||||
then
|
||||
echo "Publish label was included in the PR, won't be checking for changelog."
|
||||
else
|
||||
npx @microsoft/rush change --verify || { echo 'If you run the rush publish command locally and meant to publish the changes, add the publish label to the pr.' ; exit 1; }
|
||||
fi
|
|
@ -16,9 +16,6 @@ stages:
|
|||
- job: main
|
||||
displayName: "Build and Unit test"
|
||||
steps:
|
||||
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
||||
- template: ./templates/verify-changes.yaml
|
||||
|
||||
- template: ./templates/build.yaml
|
||||
|
||||
- script: npx @microsoft/rush test:ci -v
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
# Steps to verify there is undocumented changes in the PR.
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
LABEL_NAME=Publish
|
||||
LABEL_URL=https://api.github.com/repos/$BUILD_REPOSITORY_ID/issues/$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER/labels
|
||||
|
||||
echo "Getting labels using $LABEL_URL"
|
||||
if curl -s "$LABEL_URL" | grep "\"name\": \"$LABEL_NAME\""
|
||||
then
|
||||
echo "Publish label was included in the PR, won't be checking for changelog."
|
||||
else
|
||||
npx @microsoft/rush change --verify || { echo '\nIf you run the rush publish command locally and meant to publish the changes, add the publish label to the pr.' ; exit 1; }
|
||||
fi
|
||||
displayName: Verify change logs
|
||||
condition: eq(variables['Build.Reason'], 'PullRequest') # only run step if it is a PR
|
Загрузка…
Ссылка в новой задаче