This repository was archived by the owner on Aug 10, 2024. It is now read-only.
File tree 4 files changed +65
-2
lines changed
4 files changed +65
-2
lines changed Original file line number Diff line number Diff line change 15
15
jobs :
16
16
publish_feed_generator :
17
17
runs-on : ubuntu-latest
18
- name : Publish Feed
18
+ name : Publish Feed Generator
19
19
steps :
20
20
- name : Get Cloudflare Worker Subdomain
21
21
run : |
Original file line number Diff line number Diff line change
1
+ name : Delete Feed Generator
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ record_name :
7
+ description : " Record Name"
8
+ required : true
9
+
10
+ env :
11
+ BLUESKY_HANDLE : ${{ vars.BLUESKY_HANDLE }}
12
+ BLUESKY_APP_PASSWORD : ${{ secrets.BLUESKY_APP_PASSWORD }}
13
+
14
+ jobs :
15
+ publish_feed_generator :
16
+ runs-on : ubuntu-latest
17
+ name : Delete Feed Generator
18
+ steps :
19
+ - uses : actions/checkout@v3
20
+ - uses : actions/setup-node@v3
21
+ - name : Delete Feed Generator
22
+ env :
23
+ RECORD_NAME : ${{ inputs.record_name }}
24
+ run : |
25
+ cd feed-generator/
26
+ npm install
27
+ echo ${RECORD_NAME}
28
+ yarn deleteFeedGenerator
Original file line number Diff line number Diff line change
1
+ import dotenv from 'dotenv'
2
+ import { AtpAgent , BlobRef } from '@atproto/api'
3
+
4
+ const run = async ( ) => {
5
+ dotenv . config ( )
6
+ let config = require ( "./config.json" ) ;
7
+ const handle = `${ process . env . BLUESKY_HANDLE } `
8
+ const password = `${ process . env . BLUESKY_APP_PASSWORD } `
9
+ const recordName = `${ process . env . RECORD_NAME } `
10
+
11
+ // only update this if in a test environment
12
+ const agent = new AtpAgent ( { service : 'https://bsky.social' } )
13
+ await agent . login ( { identifier : handle , password } )
14
+
15
+ try {
16
+ await agent . api . app . bsky . feed . describeFeedGenerator ( )
17
+ } catch ( err ) {
18
+ throw new Error (
19
+ 'The bluesky server is not ready to accept published custom feeds yet' ,
20
+ )
21
+ }
22
+
23
+ let record = {
24
+ repo : agent . session ?. did ?? '' ,
25
+ collection : 'app.bsky.feed.generator' ,
26
+ rkey : recordName ,
27
+ }
28
+ let recordJSON = JSON . stringify ( record , null , 2 ) ;
29
+ console . log ( `Deleting record ${ recordJSON } ` )
30
+ let response = await agent . api . com . atproto . repo . deleteRecord ( record ) ;
31
+ let responseJSON = JSON . stringify ( response , null , 2 ) ;
32
+ console . log ( `Response: ${ responseJSON } ` )
33
+ }
34
+
35
+ run ( )
Original file line number Diff line number Diff line change 9
9
"license" : " MIT" ,
10
10
"scripts" : {
11
11
"publishFeedGenerator" : " ts-node publishFeedGenerator.ts" ,
12
- "deleteFeed " : " ts-node deleteFeed .ts"
12
+ "deleteFeedGenerator " : " ts-node deleteFeedGenerator .ts"
13
13
},
14
14
"dependencies" : {
15
15
"@atproto/api" : " ^0.3.7" ,
You can’t perform that action at this time.
0 commit comments