Skip to content

DuckPlayer page - mobile support #410

DuckPlayer page - mobile support

DuckPlayer page - mobile support #410

Workflow file for this run

name: PR Build and Release
on:
pull_request:
types: [opened, synchronize, closed, ready_for_review]
jobs:
build:
if: github.event.pull_request.draft == false && github.event.action != 'closed'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Run build
run: npm run build
- name: Create and push release branch
id: create_branch
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b pr-releases/pr-${PR_NUMBER}
git add -f build Sources
git commit -m "Add build folder for PR ${PR_NUMBER}"
git push -u origin pr-releases/pr-${PR_NUMBER} --force
echo "BRANCH_NAME=pr-releases/pr-${PR_NUMBER}" >> $GITHUB_ENV
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Post comment on PR
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const branchName = process.env.BRANCH_NAME;
const commitHash = process.env.COMMIT_HASH;
const prNumber = context.issue.number;
const repoUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}`;
const branchUrl = `${repoUrl}/tree/${branchName}`;
const commitUrl = `${repoUrl}/commit/${commitHash}`;
const commentBody = `
### Temporary Branch Update
The temporary branch has been updated with the latest changes. Below are the details:
- **Branch Name**: [${branchName}](${branchUrl})
- **Commit Hash**: [${commitHash}](${commitUrl})
- **Install Command**: \`npm i github:duckduckgo/content-scope-scripts#${commitHash}\`
Please use the above install command to update to the latest version.
`;
await github.rest.issues.createComment({
...context.repo,
issue_number: prNumber,
body: commentBody
});
clean_up:
if: github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Delete release branch
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin --delete pr-releases/pr-${PR_NUMBER}