diff --git a/.github/workflows/close-issues.yml b/.github/workflows/close-issues.yml index 7082f43fdf781..daf47e846af31 100644 --- a/.github/workflows/close-issues.yml +++ b/.github/workflows/close-issues.yml @@ -6,8 +6,7 @@ on: workflow_dispatch: permissions: - contents: read - id-token: write + issues: write # Ensure scripts are run with pipefail. See: # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference @@ -18,36 +17,12 @@ defaults: jobs: close-issues: runs-on: ubuntu-latest - environment: - name: azure - deployment: false if: github.repository == 'microsoft/TypeScript' - permissions: - contents: read # Apparently required to create issues - id-token: write - issues: write steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - uses: azure/login@a641126d1b8aa4d1fa005f4f92df94a3a4c4c906 # v3.1.0 - with: - client-id: ${{ vars.AZURE_CLIENT_ID }} - tenant-id: ${{ vars.AZURE_TENANT_ID }} - subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} - - name: Create GitHub App token - id: app-token - uses: microsoft/create-github-app-token-via-key-vault@5ba0d436e9c3cac52feff4d1f2f66f9698ce4a2d # v1 - with: - client-id: ${{ vars.TYPESCRIPT_AUTOMATION_GITHUB_APP_CLIENT_ID }} - key-id: ${{ vars.TYPESCRIPT_AUTOMATION_GITHUB_APP_KEY_ID }} - owner: microsoft - repositories: TypeScript - permission-issues: write - name: Close issues env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} + GH_TOKEN: ${{ github.token }} REPO: ${{ github.repository }} run: | DATE=$(date --date='2 days ago' --iso-8601) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index b64a34fb1f4b9..7a5cf5333f4ac 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -257,28 +257,10 @@ jobs: needs: [prepare, build-platform, pack, publish] if: ${{ !cancelled() && github.repository == 'microsoft/TypeScript' && inputs.distinct_id }} runs-on: ubuntu-latest - environment: - name: azure - deployment: false permissions: - contents: read - id-token: write + issues: write + pull-requests: write steps: - - uses: azure/login@a641126d1b8aa4d1fa005f4f92df94a3a4c4c906 # v3.1.0 - with: - client-id: ${{ vars.AZURE_CLIENT_ID }} - tenant-id: ${{ vars.AZURE_TENANT_ID }} - subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} - - name: Create GitHub App token - id: app-token - uses: microsoft/create-github-app-token-via-key-vault@5ba0d436e9c3cac52feff4d1f2f66f9698ce4a2d # v1 - with: - client-id: ${{ vars.TYPESCRIPT_AUTOMATION_GITHUB_APP_CLIENT_ID }} - key-id: ${{ vars.TYPESCRIPT_AUTOMATION_GITHUB_APP_KEY_ID }} - owner: microsoft - repositories: TypeScript - permission-issues: write - permission-pull-requests: write - name: Check build result env: PUBLISH_RESULT: ${{ needs.publish.result }} @@ -299,7 +281,7 @@ jobs: There is also a playground [for this build](https://www.typescriptlang.org/play/v2/?ts=${{ needs.publish.outputs.version }}). failure_comment: 'I was unable to build and publish this PR.' - github_token: ${{ steps.app-token.outputs.token }} + github_token: ${{ github.token }} distinct_id: ${{ inputs.distinct_id }} source_issue: ${{ inputs.source_issue }} requesting_user: ${{ inputs.requesting_user }} diff --git a/.github/workflows/tag-vscode-typescript.yml b/.github/workflows/tag-vscode-typescript.yml index b29f7737273d2..dcd2117e61659 100644 --- a/.github/workflows/tag-vscode-typescript.yml +++ b/.github/workflows/tag-vscode-typescript.yml @@ -13,8 +13,7 @@ concurrency: cancel-in-progress: false permissions: - contents: read - id-token: write + contents: write defaults: run: @@ -24,16 +23,12 @@ jobs: tag: if: github.repository == 'microsoft/TypeScript' runs-on: ubuntu-latest - environment: - name: azure - deployment: false steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: filter: blob:none fetch-depth: 2 - persist-credentials: false - name: Check for extension version bump id: version @@ -74,40 +69,17 @@ jobs: echo "changed=true" >> "$GITHUB_OUTPUT" echo "version=$version" >> "$GITHUB_OUTPUT" - - uses: azure/login@a641126d1b8aa4d1fa005f4f92df94a3a4c4c906 # v3.1.0 - if: steps.version.outputs.changed == 'true' - with: - client-id: ${{ vars.AZURE_CLIENT_ID }} - tenant-id: ${{ vars.AZURE_TENANT_ID }} - subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} - - - name: Create GitHub App token - if: steps.version.outputs.changed == 'true' - id: app-token - uses: microsoft/create-github-app-token-via-key-vault@5ba0d436e9c3cac52feff4d1f2f66f9698ce4a2d # v1 - with: - client-id: ${{ vars.TYPESCRIPT_AUTOMATION_GITHUB_APP_CLIENT_ID }} - key-id: ${{ vars.TYPESCRIPT_AUTOMATION_GITHUB_APP_KEY_ID }} - owner: microsoft - repositories: TypeScript - permission-contents: write - - name: Create release tag if: steps.version.outputs.changed == 'true' env: EXTENSION_VERSION: ${{ steps.version.outputs.version }} - GITHUB_APP_TOKEN: ${{ steps.app-token.outputs.token }} run: | set -euo pipefail tag="vscode-typescript/v$EXTENSION_VERSION" - git config user.email "290192711+typescript-automation[bot]@users.noreply.github.com" - git config user.name "typescript-automation[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "github-actions[bot]" git config core.hooksPath /dev/null - basic_auth="$(node -e 'process.stdout.write(Buffer.from("x-access-token:" + process.env.GITHUB_APP_TOKEN).toString("base64"))')" - echo "::add-mask::$basic_auth" - git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic ${basic_auth}" - if git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null; then git fetch origin "refs/tags/$tag:refs/tags/$tag" existingCommit="$(git rev-list -n 1 "$tag")"