Post release announcements to LinkedIn
Config
announce:
linkedin:
enabled: true
message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}"| Field | Type | Description |
|---|---|---|
enabled | bool | Enable LinkedIn announcements |
message_template | string | Share post text (templates supported). Default: {{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }} |
Environment variables
| Variable | Required | Description |
|---|---|---|
LINKEDIN_ACCESS_TOKEN | Yes | OAuth 2.0 access token for the posting account |
How it works
Anodizer posts to LinkedIn via the v2 Share API. Each run:
- Resolves the profile URN by calling
GET /v2/userinfo(newer endpoint, reads thesubfield). If that endpoint returns 403 Forbidden, it falls back toGET /v2/me(legacy endpoint, reads theidfield) for compatibility with older app permission grants. - Posts a share via
POST /v2/shareswith the resolved URN asowner. - Logs the resulting activity URL
(
https://www.linkedin.com/feed/update/<activity>) to standard error.
Obtaining an access token
LinkedIn access tokens are issued through OAuth 2.0. The steps depend on whether you are posting as a personal profile or a company page:
Personal profile:
- Create a LinkedIn app at https://developer.linkedin.com.
- Add the
w_member_socialproduct (Share on LinkedIn). - Complete the OAuth 2.0 authorization code flow to obtain a token with the
w_member_socialscope.
Access tokens expire. For automated CI use, generate a long-lived token or plan for token refresh.
Example
announce:
linkedin:
enabled: true
message_template: |
{{ .ProjectName }} {{ .Tag }} is out!
Release notes: {{ .ReleaseURL }}LINKEDIN_ACCESS_TOKEN=AQV...your_token_here