Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/pr_badges.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: PR badges

on:
pull_request_target:
branches: [main]

concurrency:
group: '${{ github.workflow }}-${{ inputs.platform }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.sha }}'
cancel-in-progress: true

permissions:
pull-requests: write

jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// Get the existing comments.
const {data: comments} = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
})
// Find any comment already made by the bot.
const botComment = comments.find(comment => comment.user.id === 41898282)
const commentBody = `
## Build Status
| Workflow | Status |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| lint | [![lint](https://github.com/youtube/cobalt_sandbox/actions/workflows/lint.yaml/badge.svg?branch=${{ github.head_ref }})](https://github.com/youtube/cobalt_sandbox/actions/workflows/lint.yaml?query=branch%3A${{ github.head_ref }}) |
| Android | [![android](https://github.com/youtube/cobalt_sandbox/actions/workflows/android.yaml/badge.svg?branch=${{ github.head_ref }})](https://github.com/youtube/cobalt_sandbox/actions/workflows/android.yaml?query=branch%3A${{ github.head_ref }}) |
| Evergreen | [![evergreen](https://github.com/youtube/cobalt_sandbox/actions/workflows/evergreen.yaml/badge.svg?branch=${{ github.head_ref }})](https://github.com/youtube/cobalt_sandbox/actions/workflows/evergreen.yaml?query=branch%3A${{ github.head_ref }}) |
| Linux | [![linux](https://github.com/youtube/cobalt_sandbox/actions/workflows/linux.yaml/badge.svg?branch=${{ github.head_ref }})](https://github.com/youtube/cobalt_sandbox/actions/workflows/linux.yaml?query=branch%3A${{ github.head_ref }}) |
| raspi-2 | [![raspi-2](https://github.com/youtube/cobalt_sandbox/actions/workflows/raspi-2.yaml/badge.svg?branch=${{ github.head_ref }})](https://github.com/youtube/cobalt_sandbox/actions/workflows/raspi-2.yaml?query=branch%3A${{ github.head_ref }}) |
| stub | [![stub](https://github.com/youtube/cobalt_sandbox/actions/workflows/stub.yaml/badge.svg?branch=${{ github.head_ref }})](https://github.com/youtube/cobalt_sandbox/actions/workflows/stub.yaml?query=branch%3A${{ github.head_ref }}) |
| Win32 | [![win32](https://github.com/youtube/cobalt_sandbox/actions/workflows/win32.yaml/badge.svg?branch=${{ github.head_ref }})](https://github.com/youtube/cobalt_sandbox/actions/workflows/win32.yaml?query=branch%3A${{ github.head_ref }}) |
`
if (botComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: commentBody
})
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
body: commentBody
})
}

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


## Overview
#

Cobalt is a lightweight application container (i.e. an application runtime, like
a JVM or the Flash Player) that is compatible with a subset of the W3C HTML5
Expand Down