Upgrade to DDF 2.26.28 #265
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: catalog-ui-search-dist-pr-onclose | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
delete-branch: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.pull_request.head.repo.full_name == 'codice/ddf-ui' }} | |
steps: | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16.x" | |
- name: Delete branch | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const prNumber = context.payload.pull_request.number; | |
const branchName = `catalog-ui-search-dist-${prNumber}`; | |
try { | |
await github.rest.git.deleteRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: `heads/${branchName}` | |
}); | |
console.log(`Deleted branch ${branchName}`); | |
} catch (error) { | |
if (error.status === 404) { | |
console.log(`Branch ${branchName} not found`); | |
} else { | |
throw error; | |
} | |
} | |
- name: Add comment to pull request | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const message = 'You can no longer use: \n `\"catalog-ui-search\": \"https://github.com/codice/ddf-ui#catalog-ui-search-dist-${{ github.event.pull_request.number }}\",` \n in your package.json to use this version in your project, as it has been deleted now that the pull request is closed. \n \n Instead, if the pr was merged you can now access these changes by using: \n `\"catalog-ui-search\": \"https://github.com/codice/ddf-ui#catalog-ui-search-dist-snapshot\",` \n \n Remember to use "yarn install --force" if you want to pick up changes to this version.'; | |
const prNumber = context.payload.pull_request.number; | |
github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: prNumber, | |
body: message | |
}); |