diff --git a/.gitbugtraq b/.gitbugtraq index 4d26da1..ce64897 100644 --- a/.gitbugtraq +++ b/.gitbugtraq @@ -1,6 +1,7 @@ # An example content of .gitbugtraq to put in the repository root directory. # It could instead be added as an additional section to $GIT_DIR/config. # (note that '\' need to be escaped). + [bugtraq] url = https://github.com/LieberLieber/LemonTree.DevOps.Demo/issues/%BUGID% loglinkregex = "#\\d+" diff --git a/.github/pr-instructions.md b/.github/pr-instructions.md new file mode 100644 index 0000000..f071a8f --- /dev/null +++ b/.github/pr-instructions.md @@ -0,0 +1,17 @@ + +--- + +## 🔄 Rebase Instructions + +If you need to rebase this PR against the target branch, you can trigger the automated rebase workflow by commenting: + +``` +/rebase/ +``` + +The rebase workflow will automatically: +- Rebase your PR branch against the target branch +- Resolve model conflicts using LemonTree.Automation +- Push the rebased changes + +**Note:** Only authorized contributors can trigger this workflow. diff --git a/.github/workflows/AddRebaseInstructionsOnPROpen.yml b/.github/workflows/AddRebaseInstructionsOnPROpen.yml index 7286352..145726b 100644 --- a/.github/workflows/AddRebaseInstructionsOnPROpen.yml +++ b/.github/workflows/AddRebaseInstructionsOnPROpen.yml @@ -16,26 +16,26 @@ jobs: add_instructions: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Add rebase instructions to PR body uses: actions/github-script@v8 with: script: | - const instructions = ` - ---- - -## 🔄 Rebase Instructions - -If you need to rebase this PR against the target branch, you can trigger the automated rebase workflow by commenting: - -/rebase/ - -The rebase workflow will automatically: -- Rebase your PR branch against the target branch -- Resolve model conflicts using LemonTree.Automation -- Push the rebased changes - -**Note:** Only authorized contributors can trigger this workflow.`; + const fs = require('fs'); + const path = require('path'); + + // Read instructions from file + const instructionsFile = path.join(process.env.GITHUB_WORKSPACE, '.github/pr-instructions.md'); + + let instructions = ''; + if (fs.existsSync(instructionsFile)) { + instructions = fs.readFileSync(instructionsFile, 'utf8'); + console.log('Read instructions from file'); + } else { + console.log('Instructions file not found, skipping AppendBody'); + return; + } // Get current PR const pr = await github.rest.pulls.get({ @@ -54,3 +54,5 @@ The rebase workflow will automatically: pull_number: context.issue.number, body: newBody }); + + console.log('Successfully updated PR body with instructions');