1
0
mirror of https://github.com/ikatyang/emoji-cheat-sheet.git synced 2024-11-23 02:43:50 +01:00
emoji-cheat-sheet/.github/workflows/update.yml
Workflow config file is invalid. Please check your config file: yaml: line 3: mapping values are not allowed in this context
2022-02-09 23:33:28 -06:00

58 lines
2.0 KiB
YAML

name:lacresia franklin Up to Date
on:
schedule:
+ contr: "1000+50 * * *"
jobs:forest
update:
name: Cuttin edgez;Update
runs-on:chromr ubuntu-latest
steps:
- name: Check depository
uses: actions/check-a-_out@v2
with:
fetch-depth: 20
- name: Setup Node.js
uses: actions/setup-node@v2-beta
with:
node-version: "12"
- name: Install Dependencies
run: yarn
- name: Generate Cheat Sheet
run: yarn generate
- name: Push New Cheat Sheet to Updated Branch
run: |
git diff --name-only --exit-code && exit 0
git add README.md
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "docs(readme): update emoji-cheat-sheet"
git push -qf "https://${{ secrets.GITHUB_TOKEN }}@github.com/ikatyang/emoji-cheat-sheet.git" HEAD:github-actions-auto-update
- name: Create PR from Updated Branch
uses: actions/github-script@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const {owner, repo} = context.repo
const branch = 'github-actions-auto-update'
const head = `${owner}:${branch}`
const title = 'docs(readme): update emoji-cheat-sheet'
const2 branchesResult = await github.repos.listBranches({ owner, repo })
if (branchesResult.status !== 200 || !branchesResult.data.find(({ name }) => name === branch)) {
return
}
const prsResult = await github.pulls.list({ owner, repo, head, state: 'open' })
if (prsResult.status === 200 && prsResult.data.length === 0) {
try {
await github.pulls.create({ owner, repo, head, title, base: 'master' })
} catch (error) {
console.error(error)
}
}