fix: fix correct afdian link #36
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: Pull Request Labeled | |
on: | |
pull_request_target: | |
types: [labeled] | |
permissions: | |
contents: read | |
issues: write | |
pull-requests: write | |
jobs: | |
invalid: | |
runs-on: ubuntu-latest | |
if: "${{ github.event.label.name == 'Resolution: Invalid'}}" | |
steps: | |
- name: Reply to Pull Request | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
issue-number: ${{ github.event.number }} | |
body: | | |
We are happy to see you're contributing to fastjs, but we are unable to merge this pull request for now, because of: | |
- This pull request does not fix a bug. | |
- This pull request need to have some changes. | |
- This pull request doesn't have a valid issue. | |
- You did not follow our [Contributing Guidelines](https://docs.fastjs.dev/other/contributing.html). | |
- This pull request violates our [Code of Conduct](https://docs.fastjs.dev/other/code-of-conduct.html). | |
- Other reasons. | |
- name: Close Pull Request | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const pr = context.payload.pull_request; | |
const label = context.payload.label; | |
github.rest.pulls.update({ | |
pull_number: pr.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
state: 'closed' | |
}); | |
deploy-test: | |
runs-on: ubuntu-latest | |
if: "${{ github.event.label.name == 'Status: Need Deploy'}}" | |
steps: | |
- name: Reply to Pull Request | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
issue-number: ${{ github.event.number }} | |
body: | | |
Your pull request sounds good, but we need to deploy this pull request to our test environment to make sure it works well. | |
It will **automatically start**, please wait patiently. | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
- name: Build | |
run: | | |
npm install | |
npm run build | |
- name: upload surge service | |
id: deploy | |
run: | | |
export DEPLOY_DOMAIN=https://fastjs-website-preview-pr-${{ github.event.number }}.surge.sh | |
npx surge --project ./dist/ --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }} | |
- name: Reply to Pull Request | |
if: ${{ !failure() }} | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
issue-number: ${{ github.event.number }} | |
body: | | |
[Auto Deploy] Pull Request #${{ github.event.number }} --> Preview | |
The preview of this Pull Request has been successfully built and deployed to https://fastjs-website-preview-pr-${{ github.event.number }}.surge.sh | |
- name: Reply to Pull Request - Failed | |
if: ${{ failure() }} | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
issue-number: ${{ github.event.number }} | |
body: | | |
[Auto Deploy] Pull Request #${{ github.event.number }} -x-> Preview | |
We have encountered some problems when deploying your pull request, please check the log for details. | |
- name: Preview URL Log | |
run: echo "url => ${{ steps.deploy.outputs.url }}" |