Skip to content
Closed
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
6 changes: 6 additions & 0 deletions .changes/unreleased/INTERNAL-20240722-152532.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: INTERNAL
body: Copy unreleased changelogs to vscode-terrafor on PR merge
time: 2024-07-22T15:25:32.261657-04:00
custom:
Issue: "1775"
Repository: terraform-ls
49 changes: 49 additions & 0 deletions .github/workflows/copy-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow copies the changelog entries from terraform-ls to vscode-terraform
# when a PR is merged.
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-pull_request-workflow-when-a-pull-request-merges
# https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-side-by-side
name: Copy changelog to vscode-terraform

on:
pull_request:
types:
- closed

permissions:
pull-requests: write # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#defining-access-for-the-github_token-scopes

jobs:
update_vscode_terraform_changelog:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: terraform-ls

- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: hashicorp/vscode-terraform
path: vscode-terraform

- name: Copy changelog entry
run: |
cp terraform-ls/.changes/unreleased/*.yaml vscode-terraform/.changes/unreleased/

- name: Commit changelog entry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ./vscode-terraform
git config --global user.name "${{ vars.TF_DEVEX_CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ vars.TF_DEVEX_CI_COMMIT_EMAIL }}"
git add .changes/unreleased/*.yaml
git commit -m "Copy changelog entries from terraform-ls"

# direct push
# git push "https://${{ vars.TF_DEVEX_CI_COMMIT_AUTHOR }}:${{ secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN }}@github.com/hashicorp/vscode-terraform.git"

# pull request
# gh pr create -B main -H branch_to_merge --fill