🔑 setting up x api credentials⁂
to use the x post action, you'll need to set up a developer account and create an app on x.
step 1: create a developer account⁂
- go to the x developer portal
- sign in with your x account
- apply for a developer account if you don't already have one
step 2: create a new app⁂
- in the developer portal, navigate to "projects & apps"
- click "create app"
- fill in the required information about your app
- set the app permissions to "read and write"
step 3: generate access tokens⁂
- from your app's dashboard, navigate to the "keys and tokens" tab
- generate consumer keys (app key and app secret)
- generate access token and access token secret
step 4: add credentials to github secrets⁂
- in your github repository, go to settings > secrets and variables > actions
- click "new repository secret"
- add the following secrets:
X_APP_KEY
: your app keyX_APP_SECRET
: your app secretX_ACCESS_TOKEN
: your access tokenX_ACCESS_SECRET
: your access token secret
step 5: use secrets in your workflow⁂
reference the secrets in your workflow file:
- name: post to x
uses: captradeoff/x-post-action@v1
with:
appKey: ${{ secrets.X_APP_KEY }}
appSecret: ${{ secrets.X_APP_SECRET }}
accessToken: ${{ secrets.X_ACCESS_TOKEN }}
accessSecret: ${{ secrets.X_ACCESS_SECRET }}
message: 'hello from github actions!'
troubleshooting credentials⁂
if you encounter authentication issues:
- verify that all four credentials are correctly stored in github secrets
- ensure your app has "read and write" permissions
- check that your access tokens haven't expired
- make sure your developer account is in good standing
- verify that you haven't exceeded rate limits