diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7114bcc..b8a0fed 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -59,7 +59,7 @@ jobs: name: devcard.png uses: ./ with: - devcard_id: XDCZD-PHG + user_id: XDCZD-PHG commit_filename: devcard.png commit_branch: main dryrun: true diff --git a/README.md b/README.md index 74407b1..2aa5f0a 100644 --- a/README.md +++ b/README.md @@ -16,15 +16,15 @@ jobs: - name: devcard uses: dailydotdev/action-devcard@2.3.1 with: - devcard_id: ${{ secrets.DEVCARD_ID }} + user_id: ${{ secrets.USER_ID }} ``` ## Action options ### Required -- `devcard_id`: this is the unique id of the devcard, it can be found in the URL of the devcard or [here](https://app.daily.dev/api/id). - - e.g. `https://api.daily.dev/devcards/v2/0b156485612243bfa39092.3.171e276.png` where the devcard_id is `0b156485612243bfa39092.3.171e276` +- `user_id`: this is the unique id of the devcard, it can be found in the URL of the devcard or [here](https://app.daily.dev/api/id). + - e.g. `https://api.daily.dev/devcards/v2/0b156485612243bfa39092.3.171e276.png` where the user_id is `0b156485612243bfa39092.3.171e276` - Can be found at [https://app.daily.dev/api/id](https://app.daily.dev/api/id) ### Optional @@ -53,7 +53,7 @@ jobs: - name: devcard uses: dailydotdev/action-devcard@2.3.1 with: - devcard_id: ${{ secrets.DEVCARD_ID }} + user_id: ${{ secrets.USER_ID }} commit_branch: devcard commit_filename: devcard.png commit_message: "chore: update ${filename}" diff --git a/action.yml b/action.yml index 6b74b06..a65d106 100644 --- a/action.yml +++ b/action.yml @@ -5,8 +5,8 @@ branding: icon: user-check color: gray-dark inputs: - devcard_id: - description: 'The ID of the devcard' + user_id: + description: 'Your daily.dev user id' required: true token: diff --git a/src/index.ts b/src/index.ts index 4a09332..f6c79ba 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,12 +13,12 @@ process.on('unhandledRejection', (error) => { throw error }) -const devcardURL = (devcard_id: string): string => - `https://api.daily.dev/devcards/v2/${devcard_id}.png?r=${new Date().valueOf()}&ref=action` +const devcardURL = (user_id: string): string => + `https://api.daily.dev/devcards/v2/${user_id}.png?r=${new Date().valueOf()}&ref=action` ;(async function () { try { - const devcard_id = core.getInput('devcard_id') + const user_id = core.getInput('user_id') const token = core.getInput('token') const branch = core.getInput('commit_branch') const message = core.getInput('commit_message') @@ -36,9 +36,9 @@ const devcardURL = (devcard_id: string): string => // Fetch the latest devcard try { - const { body } = await fetch(devcardURL(devcard_id)) + const { body } = await fetch(devcardURL(user_id)) if (body === null) { - const message = `Empty response from devcard URL: ${devcardURL(devcard_id)}` + const message = `Empty response from devcard URL: ${devcardURL(user_id)}` core.setFailed(message) console.debug(message) process.exit(1)