Skip to content

Commit

Permalink
add changelog check (#2530)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft committed May 6, 2024
1 parent adfeb94 commit 1d0a31a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 14 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/consistency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Consistency

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: ["main"]
pull_request:
branches: ["main"]
merge_group:
workflow_dispatch: {}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check-changes:
name: Check Changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 ## Needed for Changesets to find `main` branch
submodules: recursive

- name: Install pnpm
uses: pnpm/action-setup@v2

- run: git pull --force --no-tags origin main:main
name: Get main ref

- run: pnpm install
name: Install dependencies

- run: pnpm change verify
name: Check changelog
if: ${{ !startsWith(github.head_ref, 'publish/') && !startsWith(github.head_ref, 'dependabot/') && !startsWith(github.head_ref, 'backmerge/') }}

- run: pnpm check-version-mismatch
name: Check version mismatch

- run: pnpm lint
name: Lint project

- run: pnpm check-format
name: Check formatting
3 changes: 1 addition & 2 deletions .github/workflows/prepare-auto-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
pull-requests: write
contents: write

jobs:
Expand All @@ -34,4 +33,4 @@ jobs:
- name: Create release branch
run: node ./eng/publish.mjs
env:
GITHUB_TOKEN: ${{secrets.CUSTOM_GITHUB_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 6 additions & 12 deletions eng/pipelines/ci-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ steps:
workingDirectory: $(Build.SourcesDirectory)/autorest.python/
condition: and(succeeded(), eq(${{ parameters.updateToLatestTypespec }}, false))

- script: pnpm change verify
displayName: Check changelog
workingDirectory: $(Build.SourcesDirectory)/autorest.python/
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/publish/')), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/dependabot/')))
continueOnError: true

- script: pnpm list
displayName: Pnpm list
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/typespec-python
Expand All @@ -63,18 +69,6 @@ steps:
displayName: Build project
workingDirectory: $(Build.SourcesDirectory)/autorest.python/

- script: pnpm check-version-mismatch
displayName: Check version mismatch
workingDirectory: $(Build.SourcesDirectory)/autorest.python/

- script: pnpm lint
displayName: Lint project
workingDirectory: $(Build.SourcesDirectory)/autorest.python/

- script: pnpm check-format
displayName: Check formatting
workingDirectory: $(Build.SourcesDirectory)/autorest.python/

- script: pip install -r dev_requirements.txt
displayName: Pip install dev requirements
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"workspaces": [
"packages/*"
],
"packageManager": "[email protected]",
"scripts": {
"preinstall": "npx only-allow pnpm",
"watch": "tsc --build ./tsconfig.ws.json --watch",
Expand Down

0 comments on commit 1d0a31a

Please sign in to comment.