Skip to content

Commit

Permalink
fix: Failed to add secret: Secret names must not start with GITHUB_.
Browse files Browse the repository at this point in the history
  • Loading branch information
nonumpa committed Dec 11, 2024
1 parent be36c5c commit c41eb80
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ GEMINI_API_KEY=

# https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/authenticating-to-the-github-api#authenticating-arc-with-a-github-app
# See the step2 in the above link
GITHUB_APP_ID=
GITHUBAPP_ID=
# See the step3 in the link, and make sure to convert to base64: `base64 -i your_private_key_file > key.base64`
GITHUB_APP_PRIVATE_KEY_BASE64=
GITHUBAPP_PRIVATE_KEY_BASE64=
# Step5 in the link
GITHUB_APP_INSTALLATION_ID=
GITHUBAPP_INSTALLATION_ID=

# To generate takedown document(reply url) for moderators to review
COFACTS_URL=https://dev.cofacts.tw
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/takedown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
- name: Create takedown PR
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
GITHUB_APP_PRIVATE_KEY_BASE64: ${{ secrets.GITHUB_APP_PRIVATE_KEY_BASE64 }}
GITHUB_APP_ID: ${{ secrets.GITHUB_APP_ID }}
GITHUB_APP_INSTALLATION_ID: ${{ secrets.GITHUB_APP_INSTALLATION_ID }}
GITHUBAPP_PRIVATE_KEY_BASE64: ${{ secrets.GITHUBAPP_PRIVATE_KEY_BASE64 }}
GITHUBAPP_ID: ${{ secrets.GITHUBAPP_ID }}
GITHUBAPP_INSTALLATION_ID: ${{ secrets.GITHUBAPP_INSTALLATION_ID }}
COFACTS_URL: ${{ env.COFACTS_URL }}
COFACTS_API_URL: ${{ env.COFACTS_API_URL }}
REVIEW_REPLY_BEFORE: ${{ env.REVIEW_REPLY_BEFORE }}
Expand Down
6 changes: 3 additions & 3 deletions src/githubPR.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const prTargetBranch = 'master';
let cachedOctokit;
async function getGithubApp() {
if (cachedOctokit) return cachedOctokit;
const appId = process.env.GITHUB_APP_ID;
const appId = process.env.GITHUBAPP_ID;

// for easier to read from env, we base64 encode the private key
const privateKey = Buffer.from(
process.env.GITHUB_APP_PRIVATE_KEY_BASE64,
process.env.GITHUBAPP_PRIVATE_KEY_BASE64,
'base64'
).toString('utf-8');
const installationId = process.env.GITHUB_APP_INSTALLATION_ID;
const installationId = process.env.GITHUBAPP_INSTALLATION_ID;

const octokit = new Octokit({
authStrategy: createAppAuth,
Expand Down

0 comments on commit c41eb80

Please sign in to comment.