ci(cov): use GITHUB_TOKEN instead of DEVOLUTIONSBOT_TOKEN (#179)

This commit is contained in:
Benoît Cortier 2023-08-24 09:56:12 -04:00 committed by GitHub
parent 55176ff99b
commit 1132126c2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -28,7 +28,7 @@ jobs:
- name: Generate PR report
if: github.event.number != ''
env:
GH_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN != '' && secrets.DEVOLUTIONSBOT_TOKEN || github.token }}
GH_TOKEN: ${{ github.token }}
run: cargo xtask cov report-gh --repo "${{ github.repository }}" --pr "${{ github.event.number }}" -v
- name: Configure Git Identity

View file

@ -94,6 +94,14 @@ pub fn report_github(sh: &Shell, repo: &str, pr_id: u32) -> anyhow::Result<()> {
println!("New:\n{report}");
println!("Diff: {:+}%", diff);
// `GH_TOKEN` environment variable sanity checks
match std::env::var_os("GH_TOKEN") {
Some(value) if value.is_empty() => trace!("WARNING: `GH_TOKEN` environment variable is empty"),
Some(value) if value.is_ascii() => trace!("`GH_TOKEN` environment variable appears to be set properly"),
Some(_) => trace!("WARNING: `GH_TOKEN` environment variables value is not an ASCII string"),
None => trace!("WARNING: `GH_TOKEN` environment variable is not set"),
}
let comments = cmd!(sh, "gh api")
.arg("-H")
.arg("Accept: application/vnd.github.v3+json")